-
Notifications
You must be signed in to change notification settings - Fork 255
[Remove Vuetify from Studio] Convert Content Library unit tests to Vue Testing Library #5536
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
base: unstable
Are you sure you want to change the base?
[Remove Vuetify from Studio] Convert Content Library unit tests to Vue Testing Library #5536
Conversation
|
Thank you @vtushar06, within next two weeks, we will assign a reviewer. |
…test cases for selection mode and loading states
|
Hii @MisRob, I made some changes as you mentioned in my other PR about testing user-observable behavior instead of implementation details. |
...entcuration/contentcuration/frontend/channelList/views/Channel/__tests__/catalogList.spec.js
Show resolved
Hide resolved
...entcuration/contentcuration/frontend/channelList/views/Channel/__tests__/catalogList.spec.js
Show resolved
Hide resolved
|
@MisRob ,I applied the approach from Issue #5474 and systematically removed stubs that weren't needed.
Tests now focus on user-visible behavior, Now PR is ready for review. |
…n from unstable The contributor's StudioChip implementation is identical to ours. We'll use their version from unstable and focus on test refactoring following Issue learningequality#5536 patterns (data-present vs data-absent scenarios). Following maintainer guidance from PR learningequality#5540 review.
Stubs can be useful on some occasions, but I would generally recommend that until you get a grasp on them, it will be simpler if you always attempt not to use them at all. Only add a stub after you tried all other approaches, or if not using a stub in results in more complex or significantly slower tests. In majority of cases, you won't need them. |
|
Hi @MisRob, |
|
Hii @MisRob, This PR is now ready for review, please assign someone to review this and let me know If any more changes required. |
Summary
Converted Content Library (CatalogList) unit tests from Vue Test Utils to Vue Testing Library, focusing on user-observable behavior and removing implementation detail testing.
Key Changes:
mount()withrender()and Vue Testing Library semantic queriesmockDownloadChannelsCSV,mockDownloadChannelsPDF)mapActions/mapGetters)Test Coverage (10 tests):
Verification:
Ran npm test -- catalogList.spec.js
It passed all 15 tests
…
References
Closes: #5527
…
Reviewer guidance
Tests focus on rendered content + business logic (VTL pattern)
No internal state access (removed tests on excluded array, component methods)