test(frontend): render the dashboard search with its real children - #7627
Open
aglinxinyuan wants to merge 2 commits into
Open
test(frontend): render the dashboard search with its real children#7627aglinxinyuan wants to merge 2 commits into
aglinxinyuan wants to merge 2 commits into
Conversation
search.component.html reported 0 of 35 lines covered while its own .ts sat at 93%. That is not an untested template - it is the attribution loss recorded in apache#7458: the spec stubs its children out through TestBed.overrideComponent, and any override makes Angular re-JIT the component from its decorator metadata, leaving the re-compiled template with no source map back to the .html. Adds a describe block that renders the component with its real children, which restores attribution: the template goes from 0/35 to 35/35 lines and 6/6 functions, and the .ts rises too. The block keeps its own TestBed so the 15 existing tests keep their stubs untouched. No production file is touched.
Contributor
Automated Reviewer SuggestionsBased on the
|
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?
search.component.htmlreported 0 of 35 lines covered while its own.tssat at 93%. That is the attribution loss from #7458, not an untested template: the spec stubs its children out throughTestBed.overrideComponent, and any override re-JITs the component from its decorator metadata, so the re-compiled template has no source map back to the.htmland its bindings execute uncounted.Adds a
describeblock that renders the component with its real children, which restores attribution:search.component.htmllinessearch.component.htmlfunctionssearch.component.tslinessearch.component.tsbranchesThe block keeps its own
TestBed, so the 15 existing tests keep their stubs and assertions untouched. Same remedy as merged PR #7535.Verification
16 mutations applied and reverted, production diff empty each time. Five were then run independently, chosen against the failure modes rather than repeating the list:
[currentUid]from the child binding(sortMethodChange)no longer assignsnz-iconspannz-iconreally derives itsanticon-*class under jsdom[showResourceTypes]="true"→"false"I ran a sixth of my own afterwards — unwiring the All-type button — and it is red.
Deliberately not included
[showResourceTypes]is reported rather than pinned: repo-wide grep shows the consuming component never varies it, so the flag has one value in practice and no assertion can distinguish the two.No production file is touched.
Any related issues, documentation, discussions?
Closes #7626
How was this PR tested?
7 new on top of the existing 15. Coverage re-measured from scratch by reverting the spec, running with
--coverage, then restoring.yarn format:cipasses.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)