Merged in chore/fix-tests (pull request #3430)
Chore/fix tests * chore: Upgrade nextjs@16.1.1 * chore: upgrade next@16.1.1 * upgrade underlying types * merge * Fix broken tests * bump @swc/plugin-formatjs to latest version * bump sentry * transpile "import-in-the-middle" & "require-in-the-middle" * revert next@16.1.1 upgrade * revert transpilation addition * .
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Toast } from "./Toast"
|
||||
|
||||
import type { Meta, StoryObj } from "@storybook/nextjs-vite"
|
||||
import { expect } from "storybook/test"
|
||||
import { expect, within } from "storybook/test"
|
||||
|
||||
import { config } from "./variants.ts"
|
||||
|
||||
@@ -52,7 +52,7 @@ export const DefaultWithCustomContent: Story = {
|
||||
play: async ({ canvas }) => {
|
||||
const toast = await canvas.findByRole("status")
|
||||
expect(toast).toBeVisible()
|
||||
expect(canvas.getByText("This is a custom info toast")).toBeVisible()
|
||||
expect(await canvas.findByText("This is a custom info toast")).toBeVisible()
|
||||
},
|
||||
}
|
||||
|
||||
@@ -61,10 +61,11 @@ export const Success: Story = {
|
||||
variant: "success",
|
||||
message: "This is a success toast",
|
||||
},
|
||||
play: async ({ canvas, args }) => {
|
||||
play: async ({ canvasElement, args }) => {
|
||||
const canvas = within(canvasElement)
|
||||
const toast = await canvas.findByRole("status")
|
||||
expect(toast).toBeVisible()
|
||||
expect(canvas.getByText(args.message as string)).toBeVisible()
|
||||
expect(await canvas.findByText(args.message as string)).toBeVisible()
|
||||
},
|
||||
}
|
||||
|
||||
@@ -73,10 +74,11 @@ export const Error: Story = {
|
||||
variant: "error",
|
||||
message: "This is an error toast",
|
||||
},
|
||||
play: async ({ canvas, args }) => {
|
||||
play: async ({ canvasElement, args }) => {
|
||||
const canvas = within(canvasElement)
|
||||
const toast = await canvas.findByRole("alert")
|
||||
expect(toast).toBeVisible()
|
||||
expect(canvas.getByText(args.message as string)).toBeVisible()
|
||||
expect(await canvas.findByText(args.message as string)).toBeVisible()
|
||||
},
|
||||
}
|
||||
|
||||
@@ -85,9 +87,10 @@ export const Warning: Story = {
|
||||
variant: "warning",
|
||||
message: "This is a warning toast",
|
||||
},
|
||||
play: async ({ canvas, args }) => {
|
||||
play: async ({ args, canvasElement }) => {
|
||||
const canvas = within(canvasElement)
|
||||
const toast = await canvas.findByRole("alert")
|
||||
expect(toast).toBeVisible()
|
||||
expect(canvas.getByText(args.message as string)).toBeVisible()
|
||||
expect(await canvas.findByText(args.message as string)).toBeVisible()
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user