Add jest tests for twenty-front (#2983)
* Add jest tests for twenty-front Co-authored-by: v1b3m <vibenjamin6@gmail.com> * Fix tests --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -0,0 +1,22 @@
|
||||
import { ActivityForDrawer } from '@/activities/types/ActivityForDrawer';
|
||||
import { mockedActivities } from '~/testing/mock-data/activities';
|
||||
|
||||
import { groupActivitiesByMonth } from '../groupActivitiesByMonth';
|
||||
|
||||
describe('groupActivitiesByMonth', () => {
|
||||
it('should group activities by month', () => {
|
||||
const grouped = groupActivitiesByMonth(
|
||||
mockedActivities as unknown as ActivityForDrawer[],
|
||||
);
|
||||
|
||||
expect(grouped).toHaveLength(2);
|
||||
expect(grouped[0].items).toHaveLength(1);
|
||||
expect(grouped[1].items).toHaveLength(1);
|
||||
|
||||
expect(grouped[0].year).toBe(2023);
|
||||
expect(grouped[1].year).toBe(2023);
|
||||
|
||||
expect(grouped[0].month).toBe(11);
|
||||
expect(grouped[1].month).toBe(3);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user