Skip to content

Commit ad89e17

Browse files
authored
Fix TracesTable story (#375)
1 parent feebaec commit ad89e17

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

dashboard/src/components/TracesTable.story.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import { useMemo, useState } from 'react';
44
import type { Meta, StoryObj } from '@storybook/react';
55
import { IconSearch } from '@tabler/icons-react';
6+
import { waitFor, within } from '@testing-library/dom';
7+
import userEvent from '@testing-library/user-event';
68
import { Box, Stack, TextInput, Title } from '@mantine/core';
79
import type { Span } from '@/types';
810
import { compareRecords } from '@/utils/table';
@@ -570,4 +572,19 @@ const sequenceSortTestSpans: Span[] = [
570572

571573
export const SequenceIdSortTest: Story = {
572574
render: () => <TracesTableStoryWrapper maxWidth={1200} spans={sequenceSortTestSpans} />,
575+
play: async ({ canvasElement }) => {
576+
const canvas = within(canvasElement);
577+
const seqHeader = await canvas.findByRole('button', { name: /seq\./i });
578+
579+
await userEvent.click(seqHeader);
580+
581+
await waitFor(() => {
582+
const rows = canvas.getAllByRole('row');
583+
const firstRow = rows[1];
584+
if (!firstRow) {
585+
throw new Error('Expected at least one data row after sorting by sequence ID');
586+
}
587+
within(firstRow).getByText('task_sequence_14');
588+
});
589+
},
573590
};

0 commit comments

Comments
 (0)