Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions site/src/components/IconField/IconField.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Meta, StoryObj } from "@storybook/react-vite";
import { expect, fn, screen, userEvent, within } from "storybook/test";
import { expect, fn, screen, userEvent, waitFor, within } from "storybook/test";
import { IconField } from "./IconField";

const meta: Meta<typeof IconField> = {
Expand Down Expand Up @@ -50,6 +50,9 @@ export const OpenPicker: Story = {
});
await userEvent.click(button);
await expect(button).toHaveAttribute("aria-expanded", "true");
await expect(await screen.findByText("Smileys & People")).toBeVisible();
const popover = await screen.findByRole("dialog");
await waitFor(() =>
expect(popover.querySelector("em-emoji-picker")).toBeInTheDocument(),
);
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ export const CanEditSettings: Story = {
const canvas = within(canvasElement);
await userEvent.click(canvas.getByRole("tab", { name: "Settings" }));

await expect(canvas.getByRole("button", { name: "Enable" })).toBeEnabled();
await expect(
await canvas.findByRole("button", { name: "Enable" }),
).toBeEnabled();
},
};

Expand All @@ -68,7 +70,9 @@ export const ViewOnlyCannotEditSettings: Story = {
const canvas = within(canvasElement);
await userEvent.click(canvas.getByRole("tab", { name: "Settings" }));

await expect(canvas.getByRole("button", { name: "Enable" })).toBeDisabled();
await expect(
await canvas.findByRole("button", { name: "Enable" }),
).toBeDisabled();
await expect(
canvas.getByText(/permission to edit deployment configuration/),
).toBeVisible();
Expand Down
Loading