fix(test, frontend): stop the agent-panel tab test depending on nz-tabs click timing - #7756
Open
aglinxinyuan wants to merge 1 commit into
Open
fix(test, frontend): stop the agent-panel tab test depending on nz-tabs click timing#7756aglinxinyuan wants to merge 1 commit into
aglinxinyuan wants to merge 1 commit into
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Contributor
Backport auto-label reportThis
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7756 +/- ##
=========================================
Coverage 91.02% 91.02%
Complexity 4454 4454
=========================================
Files 1174 1174
Lines 47146 47146
Branches 5287 5287
=========================================
Hits 42916 42916
Misses 2550 2550
Partials 1680 1680
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this PR?
agent-panel.component.spec.ts's tab-selection test fails intermittently on CI with:It has now failed on both
ubuntu-latestandwindows-latestwhile passing locally — including a clean local run of the full 201-file suite — so it is a timing dependency, not a real regression. It is currently red on unrelated PRs.Cause. The test clicked the tab header and then called
fixture.detectChanges()once:nz-tabsdoes not emitnzSelectedIndexChangefrom its click handler — it emits during its own change-detection pass. So a singledetectChanges()is not guaranteed to have runonTabSelectChangeyet. Locally one pass happened to catch it; on CI it did not, andactivateAgenthad not been called.Fix. Drive the output the template binds, which is the same idiom the
nzResizetest a few cases above already uses:The DOM-level check that the tab is selectable is kept, so the case cannot pass for the wrong reason if
[nzDisabled]ever inverts:fixture.whenStable()is not usable here: the panel keeps a long-lived subscription open, so awaiting stability hangs the test to its 20s timeout. That was tried first and is recorded in the comment so nobody repeats it.The fix is not vacuous
Emitting the output still pins the binding. Two mutations of the template, applied one at a time and reverted with the production diff verified empty:
(nzSelectedIndexChange)="onTabSelectChange($event)"bindingselecting an agent's tab activates that agent and marks only its chat activeonTabSelectChange(0)instead of$eventThe test is renamed from "clicking an agent's tab header…" to "selecting an agent's tab…" so the name matches what it now does.
Any related issues, documentation, discussions?
Closes #7755
How was this PR tested?
The full frontend suite is green: 201 files, 4731 passed, 1 skipped.
yarn format:cipasses. No production file is touched.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)