Repository navigation
Description
Task Summary
frontend/src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.html reports 92.0% of lines (27 missed), 72.9% of branches and only 42.9% of functions (15/35) behind a 129-test spec.
Worth stating up front, because the obvious guess is wrong: this is not issue #7458. The spec uses no TestBed.overrideComponent, so nothing is being re-JIT'd and no attribution is lost. The gaps are real — behaviour never driven through the DOM. They fall into four groups: handlers wired to child-component outputs, controls that live inside CDK overlays (the row dropdown, the popconfirm), the whole version-creator block, and the false legs of the header and settings ternaries.
The function figure is the tell. 20 uncovered functions against only 27 uncovered lines means most of the template's handlers are never invoked, even though the elements carrying them render.
Traps worth knowing before writing anything here, all of which produce a green test that pins nothing:
- Degenerate fixtures make formatter bugs invisible.
formatTimereturns"1s"forundefined, for0, and for anything<= 0(format.util.ts:34). A row whosetotalTimeandestimatedTimeRemainingare bothundefinedrenders["1s", "1s left"]— so swapping the two bindings, a genuine user-visible bug, is undetectable. Same trap forformatSpeed:1024and40both render"0.0 MB/s". Use distinguishable values. toContainon a formatted number.expect(text).toContain("2")with a size of2048also passes on the raw number, so the formatter is unpinned. Assert"2.00 KB"exactly.expect.any(Number)/expect.anything()in a call assertion leaves argument order free — two numeric arguments can be swapped and the assertion holds.- A one-way copy is not an exchange. Mutating row A to use row B's interpolation is often already killed; the mutation that survives is the true exchange, each row keeping its label and taking the other's value. Several branch pairs here are 2/2 covered and still unpinned for exactly this reason.
[disabled]on aninput[nz-input]with[(ngModel)]does not apply synchronously.NgModelroutes it throughcontrol.disable(), deferred to a microtask, so the DOM lags one turn behinddetectChanges(). Asserting immediately reads the stale value and invites the false conclusion that the binding is inert.
Task Type
- Refactor / Cleanup
- DevOps / Deployment / CI
- Testing / QA
- Documentation
- Performance
- Other
Activity
test(frontend): drive the dataset detail template through the DOM (ap…