Skip to content

Commit df0675c

Browse files
committed
Fix validation step story to run validations before initial render
1 parent 64ec9d5 commit df0675c

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

src/steps/ValidationStep/stories/Validation.stories.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { ValidationStep } from "../ValidationStep"
33
import { Providers } from "../../../components/Providers"
44
import { defaultTheme } from "../../../ReactSpreadsheetImport"
55
import { ModalWrapper } from "../../../components/ModalWrapper"
6+
import { addErrorsAndRunHooks } from "../utils/dataMutations"
67

78
export default {
89
title: "Validation Step",
@@ -12,11 +13,14 @@ export default {
1213
}
1314

1415
const file = new File([""], "file.csv")
16+
const data = await addErrorsAndRunHooks(editableTableInitialData, mockRsiValues.fields)
1517

16-
export const Basic = () => (
17-
<Providers theme={defaultTheme} rsiValues={mockRsiValues}>
18-
<ModalWrapper isOpen={true} onClose={() => {}}>
19-
<ValidationStep initialData={editableTableInitialData} file={file} />
20-
</ModalWrapper>
21-
</Providers>
22-
)
18+
export const Basic = () => {
19+
return (
20+
<Providers theme={defaultTheme} rsiValues={mockRsiValues}>
21+
<ModalWrapper isOpen={true} onClose={() => {}}>
22+
<ValidationStep initialData={data} file={file} />
23+
</ModalWrapper>
24+
</Providers>
25+
)
26+
}

0 commit comments

Comments
 (0)