Skip to content

Commit 9f23ced

Browse files
Waldleufergeorg-schwarz
authored andcommitted
fix(storybook): restore TSX runtime compatibility and stabilize new plays
1 parent bbcf958 commit 9f23ced

3 files changed

Lines changed: 9 additions & 17 deletions

File tree

src/components/molecules/FreeTextQuestion/FreeTextQuestion.stories.tsx

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import type { Meta, StoryObj } from "@storybook/react";
2-
import { expect, fn, userEvent, within } from "storybook/test";
2+
import { expect, userEvent, within } from "storybook/test";
33

44
import { FreeTextQuestion } from "./FreeTextQuestion";
55

6-
const submitHandler = fn().mockResolvedValue(undefined);
7-
86
const meta = {
97
title: "Molecules/FreeTextQuestion",
108
component: FreeTextQuestion,
119
tags: ["autodocs"],
1210
args: {
1311
question: "What is the biggest blocker in your current research process?",
1412
minLength: 10,
15-
onSubmit: submitHandler,
1613
},
1714
parameters: {
1815
docs: {
@@ -43,10 +40,8 @@ export const WriteAndSubmit: Story = {
4340
canvas.getByRole("button", { name: "Submit answer" }),
4441
);
4542

46-
await expect(submitHandler).toHaveBeenCalledWith(
47-
expect.objectContaining({
48-
answer: "Scheduling participants quickly is hard for us.",
49-
}),
50-
);
43+
await expect(
44+
canvas.getByText("Thanks. Your answer was logged."),
45+
).toBeVisible();
5146
},
5247
};

src/components/molecules/Poll/Poll.stories.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
import type { Meta, StoryObj } from "@storybook/react";
2-
import { expect, fn, userEvent, within } from "storybook/test";
2+
import { expect, userEvent, within } from "storybook/test";
33

44
import { Poll } from "./Poll";
55

6-
const submitHandler = fn().mockResolvedValue(undefined);
7-
86
const meta = {
97
title: "Molecules/Poll",
108
component: Poll,
119
tags: ["autodocs"],
1210
args: {
1311
question: "Which interview format gives better insights for your team?",
1412
options: ["In-person sessions", "Remote moderated sessions"],
15-
onSubmit: submitHandler,
1613
},
1714
parameters: {
1815
docs: {
@@ -36,8 +33,8 @@ export const SelectAndSubmit: Story = {
3633
await userEvent.click(canvas.getByLabelText("In-person sessions"));
3734
await userEvent.click(canvas.getByRole("button", { name: "Submit vote" }));
3835

39-
await expect(submitHandler).toHaveBeenCalledWith(
40-
expect.objectContaining({ answer: "In-person sessions" }),
41-
);
36+
await expect(
37+
canvas.getByText("Thanks. Your vote was logged."),
38+
).toBeVisible();
4239
},
4340
};

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"extends": "astro/tsconfigs/strict",
33
"compilerOptions": {
44
"module": "ESNext",
5-
"jsx": "preserve",
5+
"jsx": "react-jsx",
66
"jsxImportSource": "react",
77
"baseUrl": ".",
88
"paths": {

0 commit comments

Comments
 (0)