Skip to content

Commit

Permalink
chore: remove create group
Browse files Browse the repository at this point in the history
  • Loading branch information
francisvaut committed May 21, 2024
1 parent 6f9086a commit 043cac8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 36 deletions.
36 changes: 0 additions & 36 deletions frontend/src/test/unit/services/group_service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ function resetService(): void {
groups.value = null;
}

const { project, getProjectByID } = useProject();

describe('group', (): void => {
it('gets group data by id', async () => {
resetService();
Expand Down Expand Up @@ -73,38 +71,4 @@ describe('group', (): void => {
expect(groups.value?.[0].students).toBeNull;
expect(groups.value?.[0].submissions).toBeNull();
});

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

// const projectId = '0';
// await getProjectByID(projectId);
// const exampleProject: Project | null = project.value;
// expect(exampleProject).not.toBeNull();

// const exampleGroup = new Group(
// '', // id
// 10, // score
// exampleProject, // project
// [], // students
// [], // submissions
// );

// await getGroupsByProject(projectId);

// expect(groups).not.toBeNull();
// expect(Array.isArray(groups.value)).toBe(true);
// const prevLength = groups.value?.length ?? 0;

// await createGroup(exampleGroup, projectId);
// await getGroupsByProject(projectId);

// expect(groups).not.toBeNull();
// expect(Array.isArray(groups.value)).toBe(true);
// expect(groups.value?.length).toBe(prevLength + 1);

// // Only check for fields that are sent to the backend
// expect(groups.value?.[prevLength]?.score).toBe(10);
// expect(groups.value?.[prevLength]?.project).toBeNull();
// });
});
1 change: 1 addition & 0 deletions frontend/src/test/unit/services/setup/post_handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export const postHandlers = [
const requestBody = new TextDecoder().decode(buffer);
const newGroup = JSON.parse(requestBody);
groups.push(newGroup);
console.log(JSON.stringify(newGroup))
return HttpResponse.json(groups);
}),
http.post(baseUrl + endpoints.projects.byCourse.replace('{courseId}', ':id'), async ({ request }) => {
Expand Down

0 comments on commit 043cac8

Please sign in to comment.