test(frontend): cover the compiling service and the search-results template - #7727
Merged
aglinxinyuan merged 2 commits intoAug 17, 2026
Merged
Conversation
Contributor
Automated Reviewer SuggestionsBased on the
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7727 +/- ##
============================================
- Coverage 90.93% 90.76% -0.17%
+ Complexity 4450 4403 -47
============================================
Files 1174 1173 -1
Lines 47139 46961 -178
Branches 5284 5258 -26
============================================
- Hits 42866 42626 -240
- Misses 2580 2662 +82
+ Partials 1693 1673 -20
*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?
Two frontend files, bundled because one needed a proven remedy and the other was a plain gap.
search-results.component.htmlworkflow-compiling.service.tsTests 50 -> 73.
search-results.component.tsalso rises to 42/42 lines as a side effect.Both files reach 100% of their lines, which necessarily covers all 19 of the lines Codecov reports missed (11 + 8).
The template was not undertested — it was unattributed
This is #7458, and this instance is worth recording because it presents as the opposite. The existing
describeusesTestBed.overrideComponentand does render and assert on the DOM: it checkstexera-list-itemcounts,.card-entrynodes, and load-more visibility. The template still measured 0 of 33 lines. Rendering happened; nothing was attributed. Second fingerprint: under the override the whole template function was attributed to the.tsas one uncovered span(55,35)-(79).The appended
describekeeps its ownTestBedwith no override and the realListItemComponent, so the existing tests and theStubListItemComponentare untouched.Verification
23 mutations, 23 killed, no survivors — each applied one at a time with the production file byte-compared after every revert, and the failing test read by name.
Two mutations had to be reformulated, which is the part worth flagging:
&& cardTemplateguard breaksstrictTemplatesnarrowing, so that mutant carries a companion[ngTemplateOutlet]="cardTemplate!"purely to keep it compiling. The behaviour change — card view rendering with no template — is the mutation, and it died on a DOM assertion.One survivor was found and closed during the build rather than reported:
[currentUid]="this.currentUid"replaced byentry.ownerIdpassed, because every fixture entry shared an owner. The new test gives two entries distinguishable owners (7 and 99), asserts on the rendered.owner-badge, then re-pointscurrentUidto 99 and asserts the badge moves — so a constant replacement dies too.Deliberately not included
Two branches in
workflow-compiling.service.tsare structurally unreachable, so it cannot exceed 103/105:if (!dynamicSchema) return undefined(line 241) is dead:DynamicSchemaService.getDynamicSchema()returns a non-nullableOperatorSchemaand throws on a miss. This is also the file's only uncovered statement.if (schemas.length > 0)(line 285) sits insideif (linksToThisPort.length > 0), whereschemasis precisely that array mapped, so the false leg cannot occur.A production bug is reported rather than pinned:
getAttrNames(line 362) tests required-ness against the root schema viaoperatorSchema.jsonSchema.required?.includes(attrName), whileDynamicSchemaService.mutatePropertyrecurses into nestedproperties/definitions/items. So a nested property that is required in its own sub-schema still gets""appended to its enum, and a nested optional property whose name collides with a root-level required one loses that escape hatch. The new tests exercise only root-level properties, so neither behaviour is cemented.Also noted, not cemented:
getOperatorInputSchemaMapis a getter that mutatescurrentCompilationStateInfo, flipping the whole compilation toFailedwhen two links disagree on a port schema.No production file is touched.
Any related issues, documentation, discussions?
Closes #7726
How was this PR tested?
Coverage measured with
--coverageon the same run.yarn format:cipasses, and was checked non-vacuously with a positive control: a deliberately misformatted throwaway file made it exit 1 and name the file, then was removed.Was this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 5)