Skip to content

Commit 34d89ee

Browse files
fix: broken test
1 parent b5346fc commit 34d89ee

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

apps/wiki-graph/src/app/wiki-graph-page.component.spec.ts

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,19 @@ describe('WikiGraphPageComponent', () => {
112112
// -------------------------------------------------------------------------
113113

114114
describe('child components are rendered', () => {
115-
it('renders GraphControlsComponent (app-graph-controls)', async () => {
115+
it('renders the unified toolbar controls (type toggles, search, tag filter)', async () => {
116116
const fixture = TestBed.createComponent(WikiGraphPageComponent);
117117
await fixture.whenStable();
118118
fixture.detectChanges();
119119

120+
// WikiGraphPageComponent inlines a single unified toolbar rather than
121+
// composing GraphControlsComponent — assert against that toolbar's
122+
// actual markup instead of a child component selector.
120123
const el: HTMLElement = fixture.nativeElement;
121-
expect(el.querySelector('app-graph-controls')).not.toBeNull();
124+
expect(el.querySelector('[role="toolbar"]')).not.toBeNull();
125+
expect(el.querySelector('.type-toggle')).not.toBeNull();
126+
expect(el.querySelector('.search-input')).not.toBeNull();
127+
expect(el.querySelector('.tag-select')).not.toBeNull();
122128
});
123129

124130
it('renders GraphCanvasComponent (app-graph-canvas)', async () => {
@@ -130,13 +136,21 @@ describe('WikiGraphPageComponent', () => {
130136
expect(el.querySelector('app-graph-canvas')).not.toBeNull();
131137
});
132138

133-
it('renders GraphSummaryPanelComponent (app-graph-summary-panel)', async () => {
139+
it('renders the unified toolbar summary stats (nodes, edges, orphans)', async () => {
134140
const fixture = TestBed.createComponent(WikiGraphPageComponent);
135141
await fixture.whenStable();
136142
fixture.detectChanges();
137143

144+
// WikiGraphPageComponent inlines the summary stats rather than
145+
// composing GraphSummaryPanelComponent — assert against the actual
146+
// .stat elements in the toolbar instead of a child component selector.
138147
const el: HTMLElement = fixture.nativeElement;
139-
expect(el.querySelector('app-graph-summary-panel')).not.toBeNull();
148+
const stats = el.querySelectorAll('.stat');
149+
expect(stats.length).toBeGreaterThan(0);
150+
const statsText = Array.from(stats).map(s => s.textContent).join(' ');
151+
expect(statsText).toContain('Nodes');
152+
expect(statsText).toContain('Edges');
153+
expect(statsText).toContain('Orphans');
140154
});
141155

142156
it('renders NodeDetailPanelComponent (app-node-detail-panel)', async () => {

0 commit comments

Comments
 (0)