Skip to content

Commit

Permalink
Adds cookies to Storybook setup
Browse files Browse the repository at this point in the history
  • Loading branch information
allanlasser committed Jan 26, 2024
1 parent 733c9cc commit 396b266
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
24 changes: 24 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
15 changes: 15 additions & 0 deletions src/common/dialog/stories/RevisionsDialog.stories.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
parameters: {
layout: "centered",
chromatic: { delay: 1000 },
cookie: {

Check warning on line 41 in src/common/dialog/stories/RevisionsDialog.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
csrftoken: "mockToken",
},
cookiePreserve: true,
},
argTypes: {

Check warning on line 46 in src/common/dialog/stories/RevisionsDialog.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
enabled: {
Expand Down Expand Up @@ -143,3 +147,14 @@
msw: { handlers: [revisionControl.loading, mockGetMe.loading] },
}}
/>
<Story
name="Without CSRF Token"
{args}
parameters={{

Check warning on line 153 in src/common/dialog/stories/RevisionsDialog.stories.svelte

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🧾 Statement is not covered

Warning! Not covered statement
msw: { handlers: [revisionControl.success, mockGetMe.data] },
cookie: {
csrftoken: "",
},
cookiePreserve: false,
}}
/>

0 comments on commit 396b266

Please sign in to comment.