Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nygrenh committed Jan 10, 2024
1 parent 5de55f0 commit 832e61a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions backend/api/routes/__test__/completions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ describe("API", () => {
const { get } = createRequestHelpers(ctx.port)
getCompletions = (slug: string, registered = false) =>
get(
`/api/completions/${slug}${
registered ? `?registered=${registered}` : ""
`/api/completions/${slug}${registered ? `?registered=${registered}` : ""
}`,
{},
)
Expand Down Expand Up @@ -78,7 +77,8 @@ describe("API", () => {
})
})

it("returns correctly on course, skipping registered and duplicate completions", async () => {
it("returns correctly on course, skipping registered and showing duplicate completions", async () => {
// Showing duplicate completions is important because students take exams multiple times and get multiple completions that way.
const res = await getCompletions("course1")({
headers: { Authorization: "Basic kissa" },
})
Expand All @@ -87,10 +87,12 @@ describe("API", () => {
"12400000-0000-0000-0000-000000000001",
"30000000-0000-0000-0000-000000000102",
"30000000-0000-0000-0000-000000000104",
"30000000-0000-0000-0000-000000000105",
])
})

it("returns correctly on course alias, skipping registered and duplicate completions", async () => {
it("returns correctly on course alias, skipping registered and showing duplicate completions", async () => {
// Showing duplicate completions is important because students take exams multiple times and get multiple completions that way.
const res = await getCompletions("alias")({
headers: { Authorization: "Basic kissa" },
})
Expand All @@ -99,6 +101,7 @@ describe("API", () => {
"12400000-0000-0000-0000-000000000001",
"30000000-0000-0000-0000-000000000102",
"30000000-0000-0000-0000-000000000104",
"30000000-0000-0000-0000-000000000105",
])
})

Expand Down

0 comments on commit 832e61a

Please sign in to comment.