-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mrc-5955 vitest pt 4 #222
base: mrc-5954
Are you sure you want to change the base?
mrc-5955 vitest pt 4 #222
Conversation
const checkbox = wrapper.find("input#show-unlabelled-check"); | ||
(checkbox.element as HTMLInputElement).checked = false; | ||
await checkbox.trigger("change"); | ||
expect(mockSaveUserPreferences).toHaveBeenCalledTimes(1); | ||
expect(mockSaveUserPreferences.mock.calls[0][1]).toStrictEqual({ showUnlabelledSessions: false }); | ||
}); | ||
|
||
it("can save show duplicate sessions preference", async () => { | ||
const wrapper = getWrapper({ sessionsMetadata }, currentSessionId); | ||
await wrapper.find("input#show-duplicates-check").trigger("click"); | ||
const checkbox = wrapper.find("input#show-duplicates-check"); | ||
(checkbox.element as HTMLInputElement).checked = true; | ||
await checkbox.trigger("change"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the last PR you used the "input" event for checkboxes I think - could you do the same here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh so this one was actually a bit weird, basically because we are using a v-model
in the component and in the last PR the component i was testing was using an explicit event like @input
or @change
, v-model
works in a slightly different way, it requires a change
event to trigger
same stuff here but
getMockResult
was introduced because redraw watches now also watch the result so need that in the test!