test(wizard): use signals and detectChanges#1548
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the tests for the SiWizardComponent to align with modern Angular testing practices. The changes involve migrating from class properties to signal-based inputs in the test host component and replacing the custom runOnPushChangeDetection helper with the standard fixture.componentRef.setInput() and fixture.detectChanges() APIs. This simplifies the test code, improves readability, and removes unnecessary asynchronous operations from several tests, making them more efficient. The changes are well-executed and represent a good improvement to the test suite.
There was a problem hiding this comment.
Pull request overview
Updates the SiWizardComponent unit tests to stop using the runOnPushChangeDetection() helper and instead drive updates via signal-based inputs with fixture.componentRef.setInput(...) + fixture.detectChanges(), aligning with the approach requested in issue #1528.
Changes:
- Removed usage of
runOnPushChangeDetection()from the wizard spec. - Switched host bindings for
hideNavigationandinlineNavigationto signal inputs (input(...)) and updated tests to set them viacomponentRef.setInput(...). - Converted affected
asynctests/hooks to synchronous ones where no async stabilization is needed.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Documentation. Coverage Reports: |
spliffone
left a comment
There was a problem hiding this comment.
It isn't necessary to use input for the HostComponent, can we use simple signals instead?
f8beae7 to
5887ffa
Compare
Refactored to use simple signals 👍 |
656f845 to
cf9d472
Compare
Resolves #1528