Skip to content

Commit

Permalink
chore: fix get groups by student
Browse files Browse the repository at this point in the history
  • Loading branch information
francisvaut committed May 21, 2024
1 parent f519cdf commit 6f9086a
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions frontend/src/test/unit/services/group_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,21 +59,20 @@ describe('group', (): void => {
expect(groups.value?.[1].submissions).toBeNull();
});

// it('gets groups data by student', async () => {
// resetService();
it('gets groups data by student', async () => {
resetService();

// await getGroupsByStudent('1');
// expect(groups.value).not.toBeNull();
// expect(Array.isArray(groups.value)).toBe(true);
// expect(groups.value?.length).toBe(1);

// expect(groups.value?.[0]).not.toBeNull();
// expect(groups.value?.[0]?.score).toBe(20);
// expect(groups.value?.[0]?.id).toBe('0');
// expect(groups.value?.[0]?.project).toBeNull();
// expect(groups.value?.[0]?.students).toBeNull();
// expect(groups.value?.[0]?.submissions).toBeNull();
// });
await getGroupsByStudent('1');
expect(groups.value).not.toBeNull();
expect(Array.isArray(groups.value)).toBe(true);
expect(groups.value?.length).toBe(1);

expect(groups.value?.[0].id).toBe('0');
expect(groups.value?.[0].score).toBe(20);
assertType(groups.value?.[0].project as Project)
expect(groups.value?.[0].students).toBeNull;
expect(groups.value?.[0].submissions).toBeNull();
});

// it('create group', async () => {
// resetService();
Expand Down

0 comments on commit 6f9086a

Please sign in to comment.