From 396b26617060c98986a3bd68b91fceecdc8853b3 Mon Sep 17 00:00:00 2001 From: Allan Lasser Date: Fri, 26 Jan 2024 11:25:30 -0500 Subject: [PATCH] Adds cookies to Storybook setup --- .storybook/main.ts | 1 + package-lock.json | 24 +++++++++++++++++++ package.json | 1 + .../stories/RevisionsDialog.stories.svelte | 15 ++++++++++++ 4 files changed, 41 insertions(+) diff --git a/.storybook/main.ts b/.storybook/main.ts index b696b8e61..5483e97d7 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -14,6 +14,7 @@ const config: StorybookConfig = { "@storybook/addon-essentials", "@storybook/addon-interactions", "@storybook/addon-svelte-csf", + "storybook-addon-cookie", ], framework: { name: "@storybook/svelte-webpack5", diff --git a/package-lock.json b/package-lock.json index acad0e2a4..04963aa2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -85,6 +85,7 @@ "react-dom": "^18.2.0", "serve": "^14.2.0", "storybook": "7.6.10", + "storybook-addon-cookie": "^3.2.0", "storybook-mock-date-decorator": "^1.0.1", "svelte-jester": "^3.0.0", "tape": "^5.7.2", @@ -20135,6 +20136,29 @@ "url": "https://opencollective.com/storybook" } }, + "node_modules/storybook-addon-cookie": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/storybook-addon-cookie/-/storybook-addon-cookie-3.2.0.tgz", + "integrity": "sha512-m98yfGNDbNHkvRsQVVQe+RiasoxU1c0u8SA2svuT+VfofAv3b55xZzDSnZ6Yn0h7zY9wmpRaJ4Twx+H4ryvkWQ==", + "dev": true, + "peerDependencies": { + "@storybook/blocks": "^7.0.0", + "@storybook/components": "^7.0.0", + "@storybook/manager-api": "^7.0.0", + "@storybook/preview-api": "^7.0.0", + "@storybook/types": "^7.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } + } + }, "node_modules/storybook-mock-date-decorator": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/storybook-mock-date-decorator/-/storybook-mock-date-decorator-1.0.1.tgz", diff --git a/package.json b/package.json index 327880b51..a5765a133 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,7 @@ "react-dom": "^18.2.0", "serve": "^14.2.0", "storybook": "7.6.10", + "storybook-addon-cookie": "^3.2.0", "storybook-mock-date-decorator": "^1.0.1", "svelte-jester": "^3.0.0", "tape": "^5.7.2", diff --git a/src/common/dialog/stories/RevisionsDialog.stories.svelte b/src/common/dialog/stories/RevisionsDialog.stories.svelte index 69c38ac6e..bf08cdfc4 100644 --- a/src/common/dialog/stories/RevisionsDialog.stories.svelte +++ b/src/common/dialog/stories/RevisionsDialog.stories.svelte @@ -38,6 +38,10 @@ parameters: { layout: "centered", chromatic: { delay: 1000 }, + cookie: { + csrftoken: "mockToken", + }, + cookiePreserve: true, }, argTypes: { enabled: { @@ -143,3 +147,14 @@ msw: { handlers: [revisionControl.loading, mockGetMe.loading] }, }} /> +