Skip to content
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

Open
wants to merge 2 commits into
base: mrc-5954
Choose a base branch
from
Open

mrc-5955 vitest pt 4 #222

wants to merge 2 commits into from

Conversation

M-Kusumgar
Copy link
Collaborator

@M-Kusumgar M-Kusumgar commented Nov 5, 2024

same stuff here but getMockResult was introduced because redraw watches now also watch the result so need that in the test!

@M-Kusumgar M-Kusumgar changed the title batch of tests mrc-5955 vitest pt 4 Nov 6, 2024
Comment on lines +374 to +385
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");
Copy link
Contributor

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?

Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants