Skip to content

Commit 488403c

Browse files
author
Hephaestus
committed
test(dashboard): fix PipelinesPage step count assertion for Command Center redesign
The PR wraps numeric values in font-mono spans, splitting text across elements. Update getByText(/2 steps/) to use a custom text matcher that checks parent textContent instead of relying on contiguous text.
1 parent 5139530 commit 488403c

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

dashboard/src/__tests__/PipelinesPage.test.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ describe('PipelinesPage', () => {
118118
mockGetPipelines.mockResolvedValue(mockPipelines);
119119
renderPage();
120120
await waitFor(() => {
121-
expect(screen.getByText(/2 steps/)).toBeDefined();
121+
// After Command Center redesign, the number is wrapped in font-mono span
122+
// so text is split across elements: <span><span class="font-mono">2</span> steps</span>
123+
const stepCount = screen.getByText((_content, element) =>
124+
element?.textContent === "2 steps"
125+
);
126+
expect(stepCount).toBeDefined();
122127
});
123128
});
124129

0 commit comments

Comments
 (0)