-
Notifications
You must be signed in to change notification settings - Fork 286
Comments
[Remove Vuetify from Studio] Convert content library filter bar unit tests to Vue Testing Library#5653
[Remove Vuetify from Studio] Convert content library filter bar unit tests to Vue Testing Library #5653sharma-anushka wants to merge 9 commits intolearningequality:unstable from
Conversation
👋 Thanks for contributing!
We will assign a reviewer within the next two weeks. In the meantime, please ensure that:
- You ran
pre-commitlocally - 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! 😊
MisRob
commented
Jan 20, 2026
Hi @sharma-anushka - Files Changed tab is showing 56 changed files which I believe wasn't intended. Can you have a look?
sharma-anushka
commented
Jan 20, 2026
Yes @MisRob, I think I have forgotten to drop the changes from the other issue, Ill soon revert with only the intended changes. Sorry for the inconvenience.
MisRob
commented
Jan 20, 2026
No problem @sharma-anushka , can happen. Thanks!
eb8fe63 to
b2192f3
Compare
b2192f3 to
53dd04d
Compare
Hi @sharma-anushka, thank you! Before we assign a maintainer, I will first invite the community.
📢 ✨ Community Review guidance for both authors and reviewers.
Hi @sharma-anushka 🖐️ ,
I tested the current implementation, and it works really well. I’m noting down a few considerations I found. Sorry if I’m mistaken anywhere anywhere, you can always clarify!
- The tests currently import a component
createLocalVuefrom@vue/test-utils. To fully migrate away from@vue/test-utils, we should replacecreateLocalVueby passing plugins directly to the render options or using theconfigureVuehook. - The code contains
document.body.innerHTML = ''inafterEach. The @testing-library/vue library automatically cleans up the DOM after every test. As of this, i think manual cleanup here is not needed and might even interfere with VTL’s cleanup process - Using
.v-chip__closeand.v-chiprelies on Vuetify implementation. This could be risky, especially since there is an ongoing effort in Studio to remove Vuetify. To ensure tests don’t break later, it would be better to target elements by addingdata-testattribute, which is already widely used in the codebase.
sharma-anushka
commented
Jan 23, 2026
Hi @AadarshM07. Thankyou for the considerations. I will make the changes and revert soon.
sharma-anushka
commented
Jan 24, 2026
Hi @AadarshM07 Ive made the changes you suggested. I hope this is okay now. Thankyou again for the review.
sharma-anushka
commented
Feb 2, 2026
Hi @ozer550, Ive made the changes according to the community review. If theres any other change required, let me know.
@ozer550
ozer550
left a comment
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.
Its almost there, just couple of questions and changes that came to my mind.
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.
I think this is redundant as we already have it registered in jest_config/setup.js .
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.
Instead of toBeTruthy can we use something more precise like toBe ?
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.
This might be redundant we already import this in jest_config/setup.js.
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.
Router is set up in both makeWrapper() and beforeEach() is there a specific reason for this?
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.
Hi, No. Thankyou for catching it, I have removed it now.
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.
Should we rely on better semantic tag than querySelector('i')?
sharma-anushka
commented
Feb 9, 2026
Hi @ozer550, apologies for the delay. I have refactored it according to you feedback. You may have a look. Thanks.
@ozer550
ozer550
left a comment
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.
First pass looks good, just one small comment that can be removed. Also, a small suggestion its helpful to add commit messages that are more clearer and that might help reviewers to understand the progression of the PR. Personal commit messages are usually not very informative.
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.
We can remove this comment!
sharma-anushka
commented
Feb 17, 2026
Hi @ozer550, Ive removed the unwanted comment, will keep commit messages clearer going forward.
Summary
Converted Content Library (CatalogFilterBar) unit tests from Vue Test Utils to Vue Testing Library.
Key Changes
mount()andwrapper.vmusage with Vue Testing Library’srender()and semantic queriesresetKeywords,resetCoach,removeLanguage)currentFilters)Test Coverage
References
closes #5649
Verification
Ran pnpm test -- catalogFilterBar.spec.js
Pasted Graphic