Skip to content

Commit

Permalink
already registered
Browse files Browse the repository at this point in the history
  • Loading branch information
masinnae committed May 17, 2024
1 parent a40addf commit 359af8c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions frontend/tests/views/SubjectRegisterView.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,22 @@ describe("SubjectRegisterView", () => {
uuid: "testuuid"
}
})

it("render error message", () => {
expect(wrapper.text()).toContain("test error message")
});
it("render register view", async () => {
testSubjectsUuidQuery.setError(false)
await wrapper.vm.$nextTick()
const registered = (wrapper.vm as any).registered
expect(registered).toBe(false)
expect(wrapper.text()).toContain("Registreer bij vak: testsubject")
});
it("render if already registered", async () => {
testSubjectsUuidQuery.setData(2)
await wrapper.vm.$nextTick()
const registered = (wrapper.vm as any).registered
expect(registered).toBe(true)
expect(wrapper.text()).toContain("Je bent al ingeschreven voor dit vak.")
})
});

0 comments on commit 359af8c

Please sign in to comment.