From f6d9765daf201d7a292b8fbff493d451388ece6c Mon Sep 17 00:00:00 2001 From: Marcin Tojek Date: Wed, 25 Jun 2025 10:45:55 +0200 Subject: [PATCH] fix(site): storybook: move spyOn to beforeEach (#18559) Fixes: https://github.com/coder/internal/issues/741 --- .../NotificationsPage/Troubleshooting.stories.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/src/pages/DeploymentSettingsPage/NotificationsPage/Troubleshooting.stories.tsx b/site/src/pages/DeploymentSettingsPage/NotificationsPage/Troubleshooting.stories.tsx index 052e855b28..bd3deeeee7 100644 --- a/site/src/pages/DeploymentSettingsPage/NotificationsPage/Troubleshooting.stories.tsx +++ b/site/src/pages/DeploymentSettingsPage/NotificationsPage/Troubleshooting.stories.tsx @@ -15,8 +15,10 @@ export default meta; type Story = StoryObj; export const TestNotification: Story = { - play: async ({ canvasElement }) => { + beforeEach() { spyOn(API, "postTestNotification").mockResolvedValue(); + }, + play: async ({ canvasElement }) => { const user = userEvent.setup(); const canvas = within(canvasElement);