aglinxinyuan opened a new issue, #7534:
URL: https://github.com/apache/texera/issues/7534

   ### Task Summary
   
   `hub-workflow-detail.component.html` reports **0 of 46 lines covered** while 
its own `.component.ts`
   sits at 98% with 32 passing tests. That is not an undertested template — it 
is the attribution loss
   recorded in [#7458](https://github.com/apache/texera/issues/7458), and this 
is the file to prove the
   mechanism on.
   
   The existing spec stubs the three child components out with
   `TestBed.overrideComponent(..., { remove: { imports: [...] }, add: { 
imports: [Stub...] } })`. Any
   override makes Angular re-JIT the component from its retained decorator 
metadata; the re-compiled
   template function has no source map back to the `.html`, so every binding 
still executes and none of
   it is attributed.
   
   **Measured, on this branch:**
   
   | | Before | After |
   |---|---|---|
   | `hub-workflow-detail.component.html` | 0/46 (0.0%) | **45/46 (97.8%)**, 
branches 3/3 |
   | `hub-workflow-detail.component.ts` | 97/99 (98.0%) | 97/99 (98.0%) |
   
   The remedy is to render the component with its **real** children in a block 
that keeps its own
   `TestBed`, so the 32 existing tests keep their mocked 
`WorkflowActionService` and the ten assertions
   they make on it. Wholesale de-stubbing would mean rewriting those ten 
assertions, which is a bad
   trade.
   
   What the real children need, all of it already available in the repo:
   
   - `workflowEditorTestImports` and `workflowEditorTestProviders` from
     `workspace/component/workflow-editor/workflow-editor.test-utils.ts` — the 
latter supplies the real
     `WorkflowActionService`, which the real editor requires because 
`DynamicSchemaService` reads
     `getTexeraGraph().getOperatorAddStream()`; a mocked service fails at 
construction.
   - `DragDropModule` and `PanelService` for the real mini-map.
   - A `MarkdownService` stub for the real markdown child's `<markdown>` 
element.
   - `HubService` and `WorkflowPersistService` stubs matching the shapes the 
existing mocks use
     (`getCounts` / `postView` / `isLiked` / `postLike` / `postUnlike` / 
`cloneWorkflow`).
   
   ### Task Type
   
   - [ ] Refactor / Cleanup
   - [ ] DevOps / Deployment / CI
   - [x] Testing / QA
   - [ ] Documentation
   - [ ] Performance
   - [ ] Other
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to