Skip to content

Commit

Permalink
Test: adapt unit tests after Vitest update
Browse files Browse the repository at this point in the history
The assertion `toContain` can no longer be used to check if an object
is a subset of another object. The closest equivalent is
`toMatchObject`. See:

https://github.com/vitest-dev/vitest/releases/tag/v1.0.0

RISDEV-0000
  • Loading branch information
andreasphil committed Dec 18, 2023
1 parent b06430c commit 30b46dd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion frontend/test/composables/useCaseLawMenuItems.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ describe("useCaseLawMenuItems", () => {
const menuItems = useCaseLawMenuItems(documentNumber, route)

for (const menuItem of menuItems.value) {
expect(menuItem.route.params).toContain({ documentNumber: "fake-number" })
expect(menuItem.route.params).toMatchObject({
documentNumber: "fake-number",
})
}
})

Expand Down
2 changes: 1 addition & 1 deletion frontend/test/composables/useNormMenuItems.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe("useNormMenuItems", () => {
const menuItems = useNormMenuItems(guid, route)

for (const menuItem of menuItems.value) {
expect(menuItem.route.params).toContain({ normGuid: "fake-guid" })
expect(menuItem.route.params).toMatchObject({ normGuid: "fake-guid" })
}
})

Expand Down

0 comments on commit 30b46dd

Please sign in to comment.