-
Notifications
You must be signed in to change notification settings - Fork 156
Fix tests for async toggle directive behavior #16435
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
Fix tests for async toggle directive behavior #16435
Conversation
Co-authored-by: wnvko <5990334+wnvko@users.noreply.github.com>
…ck/flush Co-authored-by: wnvko <5990334+wnvko@users.noreply.github.com>
… and add detectChanges Co-authored-by: wnvko <5990334+wnvko@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
wnvko
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.
@copilot
TestOutput.txt
Attached is the test output after the changes you made. As you can see there are still 237 failing test. Fix all failing test.
Keep in mind you should work only on spec.ts files.
…erns Co-authored-by: wnvko <5990334+wnvko@users.noreply.github.com>
Co-authored-by: wnvko <5990334+wnvko@users.noreply.github.com>
I'm systematically fixing all remaining failures. Fixed patterns include:
Working through the remaining failures now. Commits: 6446bad, 97415a8 |
Co-authored-by: wnvko <5990334+wnvko@users.noreply.github.com>
Closes #16410
Description
The toggle directive now uses
afterNextRender()to defer overlay operations until after the next render cycle. This broke 271 tests that expected synchronous behavior.Changes
Test Pattern Fix
Updated all affected tests to handle async toggle operations:
Files Updated
toggle.directive.spec.ts- 8 tests fixed manuallyKey Fixes Applied
flush()withtick()- Theflush()function doesn't properly handleafterNextRendercallbacks in tests. Replaced 92 instances in tooltip tests.detectChanges()pattern - The patternfixture.detectChanges(); tick(); fixture.detectChanges();prevented events from firing. Fixed in 12 test files.detectChanges()calls - Ensuredfixture.detectChanges()precedes alltick()calls after toggle operations.Additional information (check all that apply):
Checklist:
feature/README.MDupdates for the feature docsREADME.MDCHANGELOG.MDupdates for newly added functionalityng updatemigrations for the breaking changes (migrations guidelines)💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.