Skip to content

Conversation

@SheikhZaeem
Copy link

Summary

Refactored channelSetModal.spec.js to use Vue Testing Library and focus on user-facing behavior instead of component internals.

Ran

pnpm test -- channelList/views/ChannelSet/tests/channelSetModal.spec.js

Ref:
Screenshot 2026-02-08 at 5 21 16 PM

Closes : #5686

@learning-equality-bot
Copy link

👋 Thanks for contributing!

We will assign a reviewer within the next two weeks. In the meantime, please ensure that:

  • You ran pre-commit locally
  • All issue requirements are satisfied
  • The contribution is aligned with our Contributing guidelines. Pay extra attention to Using generative AI. Pull requests that don't follow the guidelines will be closed.

We'll be in touch! 😊


expect(wrapper.vm.$route.name).toBe(RouteNames.CHANNEL_SETS);
});
expect(screen.getByText('Field is required')).toBeInTheDocument();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion depends on the exact validation copy. If the message changes but the validation behavior stays the same, this test will fail unnecessarily.

My suggestion is to assert the validation state instead (for example via a semantic role).
expect(screen.getByRole('alert')).toBeInTheDocument();

});
expect(await screen.findByRole('heading', { name: 'Unsaved changes' })).toBeInTheDocument();
expect(
screen.getByText('You will lose any unsaved changes. Are you sure you want to exit?'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same I wanted to apply here .
expect(screen.getByRole('dialog')).toBeInTheDocument();

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.

[Remove Vuetify from Studio] Convert collection modal unit tests to Vue Testing Library

3 participants