fix: split basic catalog unit tests into per-component files#1408
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the Angular component testing suite by decomposing large test files into individual specification files for each component, alongside minor documentation updates to the catalog schema. Feedback highlights opportunities to improve test robustness and type safety, specifically by utilizing optional chaining for DOM elements, replacing 'any' types with more specific definitions as per the style guide, and adopting more resilient element selectors. Additionally, the reviewer suggests strengthening assertions by verifying specific arguments in spy calls.
|
Haha I love this! PTAL @josemontespg! |
josemontespg
left a comment
There was a problem hiding this comment.
Thanks for doing this! I left some minor comments, please take a look when you can. Also, bring the branch up to date with main and we should be good to go!
Thank you for the contribution! ❤️
Split simple-components.spec.ts and complex-components.spec.ts into individual test files, one per component. This produces smaller files with self-contained test setup, reducing complexity and merge conflict likelihood. New files created: - divider.component.spec.ts - image.component.spec.ts - icon.component.spec.ts - video.component.spec.ts - audio-player.component.spec.ts - card.component.spec.ts - check-box.component.spec.ts - choice-picker.component.spec.ts - slider.component.spec.ts - date-time-input.component.spec.ts - list.component.spec.ts - tabs.component.spec.ts - modal.component.spec.ts Deleted files: - simple-components.spec.ts - complex-components.spec.ts Fixes google#1403
c4b65db to
9cafe92
Compare
|
Thanks for the review @josemontespg! Reverted the |
|
Looks good, thanks! 👏 |
Summary
Split
simple-components.spec.tsandcomplex-components.spec.tsinto individual test files, one per component. This produces smaller files with self-contained test setup, reducing complexity and merge conflict likelihood.Changes
Deleted:
simple-components.spec.ts(6 components, 441 lines)complex-components.spec.ts(6 components, 663 lines)Created (13 files):
simple-components.spec.tscomplex-components.spec.tsdivider.component.spec.tscheck-box.component.spec.tsimage.component.spec.tschoice-picker.component.spec.tsicon.component.spec.tsslider.component.spec.tsvideo.component.spec.tsdate-time-input.component.spec.tsaudio-player.component.spec.tslist.component.spec.tscard.component.spec.tstabs.component.spec.tsmodal.component.spec.tsEach file is fully self-contained with its own mock setup — no shared state between files.
Testing
All 229 tests pass (
npm run test:ciinrenderers/angular).Fixes #1403