Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
container:
# Make sure to grab the latest version of the Playwright image
# https://playwright.dev/docs/docker#pull-the-image
image: mcr.microsoft.com/playwright:v1.54.1-noble
image: mcr.microsoft.com/playwright:v1.57.0-noble
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import svgr from "vite-plugin-svgr";

const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
staticDirs: ["../node_modules/dkfds/dist"],
staticDirs: ["../node_modules/dkfds/dist", "../src/stories/assets"],
previewHead: (head) => `${head}
<link rel="stylesheet" href="./css/dkfds.css" />
`,
Expand Down
7 changes: 6 additions & 1 deletion .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { DkfdsTranslationProvider } from "../src/contexts/translation-context";
import { loadTranslations } from "../src/stories/translations/translations";

const withSVGHeader = (Story) => {
// eslint-disable-next-line react-hooks/rules-of-hooks
const translations = loadTranslations();

return (
Expand All @@ -27,12 +26,18 @@ const preview: Preview = {
date: /Date$/i,
},
},

layout: "centered",

backgrounds: {
grid: {
opacity: 0.1,
},
},

a11y: {
test: "error",
},
},
decorators: [withSVGHeader],
tags: ["autodocs"],
Expand Down
3 changes: 2 additions & 1 deletion .storybook/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as a11yAddonAnnotations from "@storybook/addon-a11y/preview";
import { setProjectAnnotations } from "@storybook/react-vite";
import * as projectAnnotations from "./preview";

// This is an important step to apply the right configuration when testing your stories.
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
setProjectAnnotations([projectAnnotations]);
setProjectAnnotations([a11yAddonAnnotations, projectAnnotations]);
Loading