diff --git a/site/src/pages/AgentsPage/AgentsPageView.stories.tsx b/site/src/pages/AgentsPage/AgentsPageView.stories.tsx index c3cd51d681..d2a2359b97 100644 --- a/site/src/pages/AgentsPage/AgentsPageView.stories.tsx +++ b/site/src/pages/AgentsPage/AgentsPageView.stories.tsx @@ -936,23 +936,7 @@ export const WithErrorReasons: Story = { const openSettingsView = async (canvasElement: HTMLElement) => { const canvas = within(canvasElement); - const settingsLink = canvas.queryByRole("link", { name: "Settings" }); - if (settingsLink) { - await userEvent.click(settingsLink); - return; - } - - const mobileMoreOptionsButton = canvas - .getAllByRole("button", { name: "More options" }) - .find((button) => button.getAttribute("aria-haspopup") === "menu"); - if (!mobileMoreOptionsButton) { - throw new Error("Expected a mobile More options menu button."); - } - await userEvent.click(mobileMoreOptionsButton); - const body = within(canvasElement.ownerDocument.body); - await userEvent.click( - await body.findByRole("menuitem", { name: "Settings" }), - ); + await userEvent.click(await canvas.findByRole("link", { name: "Settings" })); }; export const OpensAnalyticsForAdmins: Story = {