-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into teacher-view
- Loading branch information
Showing
19 changed files
with
5,489 additions
and
4,718 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import {describe, it, expect, beforeEach} from 'vitest' | ||
import { useAdmin } from '@/composables/services/admins.service.ts' | ||
|
||
const { | ||
admins, | ||
admin, | ||
getAdminByID, | ||
getAdmins, | ||
|
||
createAdmin, | ||
deleteAdmin | ||
} = useAdmin(); | ||
|
||
describe("admin", (): void => { | ||
it("gets assistant data by id", async () => { | ||
await getAdminByID("300201547011") | ||
expect(admin.value).not.toBeNull() | ||
expect(admin.value?.username).toBe("tverslyp") | ||
expect(admin.value?.is_staff).toBe(true) | ||
expect(admin.value?.email).toBe("[email protected]") | ||
expect(admin.value?.first_name).toBe("Tybo") | ||
expect(admin.value?.last_name).toBe("Verslype") | ||
expect(admin.value?.last_enrolled).toBe(2023) | ||
expect(admin.value?.last_login).toEqual(new Date("July 23, 2024 01:15:00")) | ||
expect(admin.value?.create_time).toEqual(new Date("July 21, 2024 01:15:00")) | ||
expect(admin.value?.faculties).toEqual([]) | ||
}) | ||
|
||
it("gets admins data", async () => { | ||
await getAdmins() | ||
expect(admins).not.toBeNull() | ||
expect(Array.isArray(admins.value)).toBe(true) | ||
expect(admins.value?.length).toBe(2); | ||
|
||
expect(admins.value?.[0]?.username).toBe("tverslyp") | ||
expect(admins.value?.[0]?.is_staff).toBe(true) | ||
expect(admins.value?.[0]?.email).toBe("[email protected]") | ||
expect(admins.value?.[0]?.first_name).toBe("Tybo") | ||
expect(admins.value?.[0]?.last_name).toBe("Verslype") | ||
expect(admins.value?.[0]?.last_enrolled).toBe(2023) | ||
expect(admins.value?.[0]?.last_login).toEqual(new Date("July 23, 2024 01:15:00")) | ||
expect(admins.value?.[0]?.create_time).toEqual(new Date("July 21, 2024 01:15:00")) | ||
expect(admins.value?.[0]?.faculties).toEqual([]) | ||
|
||
expect(admins.value?.[1]?.username).toBe("simmig") | ||
expect(admins.value?.[1]?.is_staff).toBe(true) | ||
expect(admins.value?.[1]?.email).toBe("[email protected]") | ||
expect(admins.value?.[1]?.first_name).toBe("Simon") | ||
expect(admins.value?.[1]?.last_name).toBe("Mignolet") | ||
expect(admins.value?.[1]?.last_enrolled).toBe(2023) | ||
expect(admins.value?.[0]?.last_login).toEqual(new Date("July 23, 2024 01:15:00")) | ||
expect(admins.value?.[0]?.create_time).toEqual(new Date("July 21, 2024 01:15:00")) | ||
expect(admins.value?.[1]?.faculties).toEqual([]) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
import {describe, it, expect, beforeEach} from 'vitest' | ||
import { useAssistant } from '@/composables/services/assistant.service.ts' | ||
|
||
const { | ||
assistants, | ||
assistant, | ||
response, | ||
|
||
getAssistantByID, | ||
getAssistantByCourse, | ||
getAssistants, | ||
|
||
createAssistant, | ||
deleteAssistant, | ||
|
||
assistantJoinCourse, | ||
assistantLeaveCourse | ||
} = useAssistant(); | ||
|
||
describe("assistant", (): void => { | ||
it("gets assistant data by id", async () => { | ||
await getAssistantByID("235") | ||
expect(assistant.value).not.toBeNull() | ||
expect(assistant.value?.username).toBe("bsimpson") | ||
expect(assistant.value?.is_staff).toBe(false) | ||
expect(assistant.value?.email).toBe("[email protected]") | ||
expect(assistant.value?.first_name).toBe("Bart") | ||
expect(assistant.value?.last_name).toBe("Simpson") | ||
expect(assistant.value?.last_enrolled).toBe(2023) | ||
expect(assistant.value?.last_login).toBeNull() | ||
expect(assistant.value?.create_time).toEqual(new Date("July 21, 2024 01:15:00")) | ||
expect(assistant.value?.courses).toEqual([]) | ||
expect(assistant.value?.faculties).toEqual([]) | ||
}) | ||
|
||
it("gets assistants data", async () => { | ||
await getAssistants() | ||
expect(assistants).not.toBeNull() | ||
expect(Array.isArray(assistants.value)).toBe(true) | ||
expect(assistants.value?.length).toBe(2); | ||
|
||
expect(assistants.value?.[0]?.username).toBe("bsimpson") | ||
expect(assistants.value?.[0]?.is_staff).toBe(false) | ||
expect(assistants.value?.[0]?.email).toBe("[email protected]") | ||
expect(assistants.value?.[0]?.first_name).toBe("Bart") | ||
expect(assistants.value?.[0]?.last_name).toBe("Simpson") | ||
expect(assistants.value?.[0]?.last_enrolled).toBe(2023) | ||
expect(assistants.value?.[0]?.last_login).toBeNull() | ||
expect(assistants.value?.[0]?.create_time).toEqual(new Date("July 21, 2024 01:15:00")) | ||
expect(assistants.value?.[0]?.courses).toEqual([]) | ||
expect(assistants.value?.[0]?.faculties).toEqual([]) | ||
|
||
expect(assistants.value?.[1]?.username).toBe("kclijster") | ||
expect(assistants.value?.[1]?.is_staff).toBe(false) | ||
expect(assistants.value?.[1]?.email).toBe("[email protected]") | ||
expect(assistants.value?.[1]?.first_name).toBe("Kim") | ||
expect(assistants.value?.[1]?.last_name).toBe("Clijsters") | ||
expect(assistants.value?.[1]?.last_enrolled).toBe(2023) | ||
expect(assistants.value?.[0]?.last_login).toBeNull() | ||
expect(assistants.value?.[0]?.create_time).toEqual(new Date("July 21, 2024 01:15:00")) | ||
expect(assistants.value?.[1]?.courses).toEqual([]) | ||
expect(assistants.value?.[1]?.faculties).toEqual([]) | ||
}) | ||
|
||
it("gets assistants data by course", async () => { | ||
await getAssistantByCourse("1") | ||
expect(assistants).not.toBeNull() | ||
expect(Array.isArray(assistants.value)).toBe(true) | ||
expect(assistants.value?.length).toBe(2); | ||
|
||
expect(assistants.value?.[0]?.username).toBe("bsimpson") | ||
expect(assistants.value?.[0]?.is_staff).toBe(false) | ||
expect(assistants.value?.[0]?.email).toBe("[email protected]") | ||
expect(assistants.value?.[0]?.first_name).toBe("Bart") | ||
expect(assistants.value?.[0]?.last_name).toBe("Simpson") | ||
expect(assistants.value?.[0]?.last_enrolled).toBe(2023) | ||
expect(assistants.value?.[0]?.last_login).toBeNull() | ||
expect(assistants.value?.[0]?.create_time).toEqual(new Date("July 21, 2024 01:15:00")) | ||
expect(assistants.value?.[0]?.courses).toEqual([]) | ||
expect(assistants.value?.[0]?.faculties).toEqual([]) | ||
|
||
expect(assistants.value?.[1]?.username).toBe("kclijster") | ||
expect(assistants.value?.[1]?.is_staff).toBe(false) | ||
expect(assistants.value?.[1]?.email).toBe("[email protected]") | ||
expect(assistants.value?.[1]?.first_name).toBe("Kim") | ||
expect(assistants.value?.[1]?.last_name).toBe("Clijsters") | ||
expect(assistants.value?.[1]?.last_enrolled).toBe(2023) | ||
expect(assistants.value?.[0]?.last_login).toBeNull() | ||
expect(assistants.value?.[0]?.create_time).toEqual(new Date("July 21, 2024 01:15:00")) | ||
expect(assistants.value?.[1]?.courses).toEqual([]) | ||
expect(assistants.value?.[1]?.faculties).toEqual([]) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.