diff --git a/site/src/components/IconField/IconField.stories.tsx b/site/src/components/IconField/IconField.stories.tsx index f9412f25968..7def38e2fe3 100644 --- a/site/src/components/IconField/IconField.stories.tsx +++ b/site/src/components/IconField/IconField.stories.tsx @@ -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 = { @@ -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(), + ); }, }; diff --git a/site/src/pages/DeploymentSettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPage.stories.tsx b/site/src/pages/DeploymentSettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPage.stories.tsx index 4a2da8d58c6..b29df894c07 100644 --- a/site/src/pages/DeploymentSettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPage.stories.tsx +++ b/site/src/pages/DeploymentSettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPage.stories.tsx @@ -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(); }, }; @@ -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();