test(cockpit): cover Container & DashboardGrid view components#148
Merged
Conversation
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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Summary
ContainerComponentandDashboardGridComponent— 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.RenderElementComponent, which callsinject(RENDER_CONTEXT)and would throw NG0201 in a bare TestBed. Specs useTestBed.overrideComponent(...).remove/add({ imports })to swap the real component for a localStubRenderElementComponentmatching the<render-element>selector and public inputs — DOM count assertions still work without wiring the full render pipeline.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 filesnpx nx affected -t test --base=origin/main— greencontainer.component.ts/dashboard-grid.component.ts🤖 Generated with Claude Code