mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-24 04:23:57 +03:00
Increase test coverage
This commit is contained in:
parent
cac00e93b8
commit
70bbc65e61
@ -0,0 +1,48 @@
|
||||
import { getHighlightedDates } from '@/ui/input/components/internal/date/utils/getHighlightedDates';
|
||||
|
||||
describe('getHighlightedDates', () => {
|
||||
it('should should return empty if range is undefined', () => {
|
||||
const dateRange = undefined;
|
||||
expect(getHighlightedDates(dateRange)).toEqual([]);
|
||||
});
|
||||
|
||||
it('should should return empty if range is one day', () => {
|
||||
const dateRange = {
|
||||
start: new Date('2024-10-12T00:00:00.000Z'),
|
||||
end: new Date('2024-10-12T00:00:00.000Z'),
|
||||
};
|
||||
expect(getHighlightedDates(dateRange)).toEqual([
|
||||
new Date('2024-10-12T00:00:00.000Z'),
|
||||
]);
|
||||
});
|
||||
|
||||
it('should should return empty if range is 2 days', () => {
|
||||
const dateRange = {
|
||||
start: new Date('2024-10-12T00:00:00.000Z'),
|
||||
end: new Date('2024-10-13T00:00:00.000Z'),
|
||||
};
|
||||
expect(getHighlightedDates(dateRange)).toEqual([
|
||||
new Date('2024-10-12T00:00:00.000Z'),
|
||||
new Date('2024-10-13T00:00:00.000Z'),
|
||||
]);
|
||||
});
|
||||
|
||||
it('should should return empty if range is 10 days', () => {
|
||||
const dateRange = {
|
||||
start: new Date('2024-10-12T00:00:00.000Z'),
|
||||
end: new Date('2024-10-21T00:00:00.000Z'),
|
||||
};
|
||||
expect(getHighlightedDates(dateRange)).toEqual([
|
||||
new Date('2024-10-12T00:00:00.000Z'),
|
||||
new Date('2024-10-13T00:00:00.000Z'),
|
||||
new Date('2024-10-14T00:00:00.000Z'),
|
||||
new Date('2024-10-15T00:00:00.000Z'),
|
||||
new Date('2024-10-16T00:00:00.000Z'),
|
||||
new Date('2024-10-17T00:00:00.000Z'),
|
||||
new Date('2024-10-18T00:00:00.000Z'),
|
||||
new Date('2024-10-19T00:00:00.000Z'),
|
||||
new Date('2024-10-20T00:00:00.000Z'),
|
||||
new Date('2024-10-21T00:00:00.000Z'),
|
||||
]);
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user