From dcbba5ea9d3485f6ed90b5ce7231d4ec1db69edc Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 23 Jul 2025 13:06:33 +0100 Subject: [PATCH] Script for updating storybook screenshots (#30340) * Script for updating storybook screenshots Requires https://github.com/element-hq/element-modules/pull/43 * Prettier --- .storybook/main.ts | 3 +++ package.json | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.storybook/main.ts b/.storybook/main.ts index ef8b8cd19c..fc4daac88a 100644 --- a/.storybook/main.ts +++ b/.storybook/main.ts @@ -31,6 +31,9 @@ const config: StorybookConfig = { }, // Needed for counterpart to work plugins: [nodePolyfills({ include: ["process", "util"] })], + server: { + allowedHosts: ["localhost", ".docker.internal"], + }, }); }, }; diff --git a/package.json b/package.json index 180438e7b6..428f8f1460 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,8 @@ "storybook": "storybook dev -p 6007", "build-storybook": "storybook build", "test:storybook": "test-storybook --url http://localhost:6007/", - "test:storybook:ci": "concurrently -k -s first -n \"SB,TEST\" \"yarn storybook\" \"wait-on tcp:6007 && yarn test-storybook --url http://localhost:6007/ --ci --maxWorkers=2\"" + "test:storybook:ci": "concurrently -k -s first -n \"SB,TEST\" \"yarn storybook --no-open\" \"wait-on tcp:6007 && yarn test-storybook --url http://localhost:6007/ --ci --maxWorkers=2\"", + "test:storybook:update": "playwright-screenshots --entrypoint yarn --with-node-modules && playwright-screenshots --entrypoint /work/node_modules/.bin/test-storybook --with-node-modules --url http://host.docker.internal:6007/ --updateSnapshot" }, "resolutions": { "**/pretty-format/react-is": "19.1.0",