Skip to content
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

feat: convert components to use OnPush change detection strategy #3093

Closed

Conversation

Rrothschild18
Copy link

Update components to use On Push, part of issue-3066

Changelog

Changed

Select + fix unit tests
Loader
Progress
Number input + fix unit tests

While migrating components to use OnPush change detection, some unit tests started failing. The issue was that the fixture wasn't updating to new input values even when using fixture.detectChanges().

My research revealed that Angular v14 introduced a new API for setting input properties for fixture.componentRef: setInput (commit) that seems to work as before.

However, using fixture.componentRef.setInput(propertyName, value) didn't resolve all test failures. I had to manually trigger change detection in those cases.

If my approach is incorrect, please let me know the best way to handle these unit testing scenarios.

klaascuvelier and others added 9 commits December 16, 2024 19:49
Co-authored-by: Akshat Patel <38994122+Akshat55@users.noreply.github.com>
Signed-off-by: rrothschild18 <raultonello18@gmail.com>
Signed-off-by: rrothschild18 <raultonello18@gmail.com>
Signed-off-by: rrothschild18 <raultonello18@gmail.com>
Signed-off-by: rrothschild18 <raultonello18@gmail.com>
Signed-off-by: rrothschild18 <raultonello18@gmail.com>
…#3066

Signed-off-by: rrothschild18 <raultonello18@gmail.com>
Signed-off-by: rrothschild18 <raultonello18@gmail.com>
…system#3066

Signed-off-by: rrothschild18 <raultonello18@gmail.com>
@Rrothschild18 Rrothschild18 requested a review from a team as a code owner January 23, 2025 23:06
Copy link

github-actions bot commented Jan 23, 2025

DCO Assistant Lite bot All contributors have signed the DCO.

Copy link

netlify bot commented Jan 23, 2025

Deploy Preview for carbon-components-angular ready!

Name Link
🔨 Latest commit 0d058e2
🔍 Latest deploy log https://app.netlify.com/sites/carbon-components-angular/deploys/6792cb877aac2100082935a7
😎 Deploy Preview https://deploy-preview-3093--carbon-components-angular.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Jan 23, 2025

Deploy Preview for carbon-angular-next ready!

Name Link
🔨 Latest commit 0d058e2
🔍 Latest deploy log https://app.netlify.com/sites/carbon-angular-next/deploys/6792cb87d6df730008afe2af
😎 Deploy Preview https://deploy-preview-3093--carbon-angular-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Rrothschild18
Copy link
Author

I have read the DCO document and I hereby sign the DCO.

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.

2 participants