Skip to content

Commit 377980f

Browse files
authored
test(Chromatic): merge table samples (#4739)
Co-authored-by: Bruno Henriques <[email protected]>
1 parent 3056fde commit 377980f

File tree

1 file changed

+16
-98
lines changed

1 file changed

+16
-98
lines changed

packages/core/src/Table/stories/Table.stories.tsx

Lines changed: 16 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { StoryObj } from "@storybook/react";
22
import { userEvent, within } from "@storybook/test";
33
import {
4-
HvSimpleGrid,
54
HvTable,
65
HvTableBody,
76
HvTableCell,
@@ -12,14 +11,9 @@ import {
1211
HvTableRow,
1312
} from "@hitachivantara/uikit-react-core";
1413

15-
import { TableComplete } from "./TableComplete/TableCompleteSample";
16-
import { AlternativeLayout } from "./TableHooks/AlternativeLayout";
1714
import { ColumnResize } from "./TableHooks/ColumnResize";
1815
import { TestHeaders as TestHeadersStory } from "./TableHooks/TableHooks.stories";
1916
import { UseHvGroupBy } from "./TableHooks/UseHvGroupBy";
20-
import { UseHvHeaderGroups } from "./TableHooks/UseHvHeaderGroups";
21-
import { UseHvRowExpand } from "./TableHooks/UseHvRowExpand";
22-
import { UseHvTableSticky } from "./TableHooks/UseHvTableSticky";
2317
import { AllColumnRenderers } from "./TableRenderers/AllColumnRenderers";
2418
import { GroupedRows as GroupedRowsStory } from "./TableSamples/GroupedRows";
2519
import GroupedRowsRaw from "./TableSamples/GroupedRows?raw";
@@ -33,7 +27,6 @@ import { ResponsiveTable as ResponsiveTableStory } from "./TableSamples/Responsi
3327
import ResponsiveTableRaw from "./TableSamples/ResponsiveTable?raw";
3428
import { SimpleTable as SimpleTableStory } from "./TableSamples/SimpleTable";
3529
import SimpleTableRaw from "./TableSamples/SimpleTable?raw";
36-
import { CompleteTableSection } from "./TableSection/CompleteTableSection";
3730
import { PropsTableSection } from "./TableSection/PropsTableSection";
3831
import { setupChromatic } from ".storybook/setupChromatic";
3932

@@ -132,62 +125,6 @@ export const ListRow: StoryObj<HvTableProps> = {
132125
};
133126

134127
export const Test: StoryObj = {
135-
parameters: {
136-
...setupChromatic([
137-
"DS3 dawn",
138-
"DS3 wicked",
139-
"DS5 dawn",
140-
"DS5 wicked",
141-
"Pentaho+ dawn",
142-
"Pentaho+ wicked",
143-
]),
144-
docs: { disable: true },
145-
a11y: {
146-
disable: true,
147-
},
148-
},
149-
tags: ["skipTestRunner"],
150-
render: (args, context: any) => (
151-
<HvSimpleGrid cols={2}>
152-
{ListRow.render?.(ListRow.args as any, context)}
153-
{GroupedRows.render?.(GroupedRows.args as any, context)}
154-
{NoData.render?.(NoData.args as any, context)}
155-
{Main.render?.(Main.args as any, context)}
156-
{SimpleTable.render?.(SimpleTable.args as any, context)}
157-
</HvSimpleGrid>
158-
),
159-
};
160-
161-
export const Test2: StoryObj = {
162-
parameters: {
163-
...setupChromatic(
164-
[
165-
"DS3 dawn",
166-
"DS3 wicked",
167-
"DS5 dawn",
168-
"DS5 wicked",
169-
"Pentaho+ dawn",
170-
"Pentaho+ wicked",
171-
],
172-
5000,
173-
),
174-
docs: { disable: true },
175-
a11y: {
176-
disable: true,
177-
},
178-
},
179-
tags: ["skipTestRunner"],
180-
render: () => (
181-
<HvSimpleGrid cols={2}>
182-
<TableComplete />
183-
<AlternativeLayout />
184-
<ColumnResize />
185-
<UseHvTableSticky />
186-
</HvSimpleGrid>
187-
),
188-
};
189-
190-
export const Test3: StoryObj = {
191128
parameters: {
192129
...setupChromatic([
193130
"DS3 dawn",
@@ -211,45 +148,26 @@ export const Test3: StoryObj = {
211148
name: /collapse/i,
212149
})[0];
213150
await userEvent.click(collapseButton);
214-
215-
// Row expand
216-
const expandButton = canvas.getAllByRole("button", { name: /expand/i })[0];
217-
await userEvent.click(expandButton);
218151
},
219-
render: () => (
220-
<HvSimpleGrid cols={2}>
221-
<UseHvHeaderGroups />
222-
<UseHvRowExpand />
223-
<UseHvGroupBy />
224-
<CompleteTableSection />
225-
</HvSimpleGrid>
226-
),
227-
};
228-
229-
export const Test4: StoryObj = {
230-
parameters: {
231-
...setupChromatic([
232-
"DS3 dawn",
233-
"DS3 wicked",
234-
"DS5 dawn",
235-
"DS5 wicked",
236-
"Pentaho+ dawn",
237-
"Pentaho+ wicked",
238-
]),
239-
docs: { disable: true },
240-
a11y: {
241-
disable: true,
242-
},
243-
},
244-
tags: ["skipTestRunner"],
245152
render: (args, context: any) => (
246153
<>
247-
<AllColumnRenderers />
154+
<div className="grid grid-cols-2 gap-sm">
155+
<div className="flex flex-col gap-sm">
156+
{Main.render?.(Main.args as any, context)}
157+
<UseHvGroupBy />
158+
{GroupedRows.render?.(GroupedRows.args as any, context)}
159+
{SimpleTable.render?.(SimpleTable.args as any, context)}
160+
</div>
161+
<div className="flex flex-col gap-sm">
162+
{NoData.render?.(NoData.args as any, context)}
163+
<ColumnResize />
164+
{TestHeadersStory.render?.(TestHeadersStory.args as any, context)}
165+
<PropsTableSection />
166+
{ListRow.render?.(ListRow.args as any, context)}
167+
</div>
168+
</div>
248169
<br />
249-
<HvSimpleGrid cols={2}>
250-
<PropsTableSection />
251-
{TestHeadersStory.render?.(TestHeadersStory.args as any, context)}
252-
</HvSimpleGrid>
170+
<AllColumnRenderers />
253171
</>
254172
),
255173
};

0 commit comments

Comments
 (0)