diff --git a/site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.stories.tsx b/site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.stories.tsx index 3004762e9c..2a7c171d3d 100644 --- a/site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.stories.tsx +++ b/site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.stories.tsx @@ -47,7 +47,17 @@ const meta: Meta = { export default meta; type Story = StoryObj; -export const Example: Story = {}; +export const Example: Story = { + play: async ({ canvasElement }) => { + const canvas = within(canvasElement); + const backLink = canvas.getByRole("link", { name: "Back to the template" }); + await expect(backLink).toBeVisible(); + await expect(backLink).toHaveAttribute( + "aria-label", + "Back to the template", + ); + }, +}; export const UndefinedLogs: Story = { args: { diff --git a/site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.tsx b/site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.tsx index 1aac65b885..5b505b95be 100644 --- a/site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.tsx +++ b/site/src/pages/TemplateVersionEditorPage/TemplateVersionEditor.tsx @@ -223,7 +223,10 @@ export const TemplateVersionEditor: FC = ({ - + diff --git a/site/src/pages/WorkspacePage/WorkspaceTopbar.stories.tsx b/site/src/pages/WorkspacePage/WorkspaceTopbar.stories.tsx index 6fd4ce86b6..5a14bf2a9b 100644 --- a/site/src/pages/WorkspacePage/WorkspaceTopbar.stories.tsx +++ b/site/src/pages/WorkspacePage/WorkspaceTopbar.stories.tsx @@ -54,7 +54,14 @@ const meta: Meta = { export default meta; type Story = StoryObj; -export const Example: Story = {}; +export const Example: Story = { + play: async ({ canvasElement }) => { + const canvas = within(canvasElement); + const backLink = canvas.getByRole("link", { name: "Back to workspaces" }); + await expect(backLink).toBeVisible(); + await expect(backLink).toHaveAttribute("aria-label", "Back to workspaces"); + }, +}; export const Outdated: Story = { args: { diff --git a/site/src/pages/WorkspacePage/WorkspaceTopbar.tsx b/site/src/pages/WorkspacePage/WorkspaceTopbar.tsx index 6d5a470cf6..9e0a3300fe 100644 --- a/site/src/pages/WorkspacePage/WorkspaceTopbar.tsx +++ b/site/src/pages/WorkspacePage/WorkspaceTopbar.tsx @@ -121,7 +121,7 @@ export const WorkspaceTopbar: FC = ({ - +