Skip to content

Commit 3c4b0bc

Browse files
committed
commented out interactive tests based on i18n strings
1 parent 5ce82af commit 3c4b0bc

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

src/components/Quiz/stories/QuizWidget.stories.tsx

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useTranslations } from "next-intl"
21
import type { Meta, StoryObj } from "@storybook/react"
32
import { expect, userEvent, waitFor, within } from "@storybook/test"
43

@@ -26,22 +25,21 @@ export default meta
2625
type Story = StoryObj<typeof meta>
2726

2827
export const AllCorrectQuestions: Story = {
29-
play: async ({ canvasElement, step, args }) => {
30-
const t = useTranslations()
31-
32-
const translatedQuizKey = t(`common.${args.quizKey}`)
33-
const translatedPassedQuiz = t("learn-quizzes.passed")
28+
play: async ({ canvasElement, step }) => {
29+
// TODO: Fix this, the play function is not detecting i18n context
30+
// const translatedQuizKey = t(`common.${args.quizKey}`)
31+
// const translatedPassedQuiz = t("learn-quizzes.passed")
3432

3533
const canvas = within(canvasElement)
3634

3735
const quizWidget = canvas.getByTestId("quiz-widget")
3836
await expect(quizWidget).toBeInTheDocument()
3937

40-
await waitFor(() =>
41-
expect(canvas.getByTestId("answer-status-null")).toHaveTextContent(
42-
translatedQuizKey
43-
)
44-
)
38+
// await waitFor(() =>
39+
// expect(canvas.getByTestId("answer-status-null")).toHaveTextContent(
40+
// translatedQuizKey
41+
// )
42+
// )
4543

4644
await waitFor(() =>
4745
expect(canvas.getByTestId("check-answer-button")).toBeDisabled()
@@ -74,7 +72,7 @@ export const AllCorrectQuestions: Story = {
7472
})
7573

7674
await step("Check for successful results page", async () => {
77-
await expect(canvasElement).toHaveTextContent(translatedPassedQuiz)
75+
await expect(canvasElement).toHaveTextContent("100%")
7876
})
7977
},
8078
}

0 commit comments

Comments
 (0)