Skip to content

test(cockpit): cover Container & DashboardGrid view components#148

Merged
blove merged 4 commits into
mainfrom
test/genui-phase2-view-coverage
May 1, 2026
Merged

test(cockpit): cover Container & DashboardGrid view components#148
blove merged 4 commits into
mainfrom
test/genui-phase2-view-coverage

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented May 1, 2026

Summary

  • Adds unit-test specs for ContainerComponent and DashboardGridComponent — the two generative-ui dashboard views shipped in feat: generative UI phase 2 — SaaS metrics dashboard #127 (9b621521) without coverage. All 6 dashboard views now meet the example's testing convention.
  • Both components import RenderElementComponent, which calls inject(RENDER_CONTEXT) and would throw NG0201 in a bare TestBed. Specs use TestBed.overrideComponent(...).remove/add({ imports }) to swap the real component for a local StubRenderElementComponent matching the <render-element> selector and public inputs — DOM count assertions still work without wiring the full render pipeline.
  • Plan and rationale at docs/superpowers/plans/2026-04-30-genui-phase2-test-gaps.md.

Test Plan

  • npx nx test cockpit-chat-generative-ui-angular — 21/21 passing across 6 view spec files
  • npx nx affected -t test --base=origin/main — green
  • No edits to container.component.ts / dashboard-grid.component.ts

🤖 Generated with Claude Code

blove and others added 4 commits April 30, 2026 17:24
Adds unit-test specs for ContainerComponent and DashboardGridComponent —
the two views shipped in PR #127 (9b62152) without specs.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
The original spec code imported ContainerComponent / DashboardGridComponent
directly into TestBed without addressing that <render-element> is itself a
standalone component which calls `inject(RENDER_CONTEXT)`. With non-empty
childKeys, Angular instantiated the real RenderElementComponent and threw
NG0201. Plan now uses TestBed.overrideComponent to swap in a local
StubRenderElementComponent that matches the selector and public inputs.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment May 1, 2026 0:54am
cacheplane-minting-service Error Error May 1, 2026 0:54am

Request Review

@blove blove merged commit 18644ef into main May 1, 2026
14 of 15 checks passed
@blove blove deleted the test/genui-phase2-view-coverage branch May 7, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant