Skip to content

Drive the dataset detail template through the DOM #7680

Closed

Description

@aglinxinyuan

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:

  1. Degenerate fixtures make formatter bugs invisible. formatTime returns "1s" for undefined, for 0, and for anything <= 0 (format.util.ts:34). A row whose totalTime and estimatedTimeRemaining are both undefined renders ["1s", "1s left"] — so swapping the two bindings, a genuine user-visible bug, is undetectable. Same trap for formatSpeed: 1024 and 40 both render "0.0 MB/s". Use distinguishable values.
  2. toContain on a formatted number. expect(text).toContain("2") with a size of 2048 also passes on the raw number, so the formatter is unpinned. Assert "2.00 KB" exactly.
  3. expect.any(Number) / expect.anything() in a call assertion leaves argument order free — two numeric arguments can be swapped and the assertion holds.
  4. 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.
  5. [disabled] on an input[nz-input] with [(ngModel)] does not apply synchronously. NgModel routes it through control.disable(), deferred to a microtask, so the DOM lags one turn behind detectChanges(). 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

  1. added a commit that references this issue on Aug 15, 2026
    00fe327
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions