Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

test(flows): update flow runs sidebar tests

Steven Enamakela24696d41065
diff --git a/app/src/components/flows/FlowRunsSidebar.test.tsx b/app/src/components/flows/FlowRunsSidebar.test.tsx
index 40f71bd7ee..6263207b5a 100644
--- a/app/src/components/flows/FlowRunsSidebar.test.tsx
+++ b/app/src/components/flows/FlowRunsSidebar.test.tsx
@@ -104,13 +104,22 @@ describe('FlowRunsSidebar', () => {
expect(screen.getByTestId('flow-run-inspector-drawer-stub')).toHaveTextContent('run-1');
});
- it('overrides the default badge padding for the compact status badge', async () => {
+ it('paints the status exactly once per row: a coloured dot plus plain text', async () => {
listFlowRuns.mockResolvedValue([makeRun()]);
renderSidebar();
- const badge = await screen.findByText('Failed');
- expect(badge).toHaveClass('px-1.5');
- expect(badge).not.toHaveClass('px-2');
+ const row = await screen.findByTestId('flow-runs-sidebar-run-run-1');
+
+ // This row used to render the status TWICE — a coloured dot AND the same
+ // word again as an accented badge — which put three visual weights in a
+ // row whose job is "which run, how long ago". The dot is the only thing
+ // carrying the accent now; the label beside it is plain text. Replaces an
+ // assertion on that badge's padding override, which pinned the styling of
+ // a element that should not have been there.
+ expect(row.querySelectorAll('[aria-hidden="true"]')).toHaveLength(1);
+ expect(row.querySelector('[aria-hidden="true"]')).toHaveClass('bg-coral-500');
+ expect(within(row).getByText('Failed')).not.toHaveClass('bg-coral-50');
+ expect(row).toHaveTextContent('Failed');
});
it('falls back to a humanized label instead of "undefined" for an unrecognized status (F-m8)', async () => {
@@ -213,7 +222,9 @@ describe('FlowRunsSidebar', () => {
'bg-amber-500',
'animate-pulse'
);
- expect(screen.getByText('Awaiting approval')).toHaveClass('bg-amber-50');
+ // The accent rides on the dot alone — see the "exactly once per row" spec
+ // above for why the duplicate accented badge is gone.
+ expect(screen.getByText('Awaiting approval')).not.toHaveClass('bg-amber-50');
});
it('leaves a running run without a matching approval labeled "Running"', async () => {