Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Remove storyshots
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 committed Dec 28, 2023
1 parent a0a4e17 commit 6c7a38d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 137 deletions.
4 changes: 0 additions & 4 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const config: StorybookConfig = {
"@storybook/addon-essentials",
"@storybook/addon-interactions",
"@storybook/addon-links",
"@storybook/addon-storyshots",
"storybook-addon-apollo-client",
],
framework: {
Expand All @@ -19,6 +18,3 @@ const config: StorybookConfig = {
},
};

// storybook/addon-storyshots does not support es6 module exports so we must use commonjs
// https://github.com/storybookjs/storybook/issues/20814
module.exports = config;
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@
"@storybook/addon-essentials": "7.6.6",
"@storybook/addon-interactions": "7.6.6",
"@storybook/addon-links": "7.6.6",
"@storybook/addon-storyshots": "7.6.6",
"@storybook/react": "7.6.6",
"@storybook/react-vite": "7.6.6",
"@storybook/testing-library": "0.2.2",
Expand Down
30 changes: 1 addition & 29 deletions src/storybook.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import initStoryshots from "@storybook/addon-storyshots";
import { render } from "@testing-library/react";
import MatchMediaMock from "jest-matchmedia-mock";

let matchMedia;
describe("storybook", () => {
describe.skip("storybook", () => {
jest.setTimeout(20000);

beforeAll(() => {
Expand Down Expand Up @@ -31,30 +29,4 @@ describe("storybook", () => {
matchMedia.clear();
jest.restoreAllMocks();
});

// eslint-disable-next-line jest/require-hook
initStoryshots({
renderer: render,
asyncJest: true,
test: ({ context, done, stories2snapsConverter, story }) => {
const snapshotFileName =
stories2snapsConverter.getSnapshotFileName(context);

// eslint-disable-next-line testing-library/render-result-naming-convention
const jsx = story.render();
const { container, unmount } = render(jsx);

// Mount components asynchronously to allow for initial state to be set.
// Some components have a loading state that is set on mount we should wait for it to finish
// before taking a snapshot.
const waitTime = 1;
setTimeout(() => {
if (snapshotFileName) {
expect(container).toMatchSpecificSnapshot(snapshotFileName);
}
}, waitTime);
unmount();
done?.();
},
});
});
109 changes: 6 additions & 103 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4959,28 +4959,6 @@
"@storybook/global" "^5.0.0"
ts-dedent "^2.0.0"

"@storybook/[email protected]":
version "7.6.6"
resolved "https://registry.yarnpkg.com/@storybook/addon-storyshots/-/addon-storyshots-7.6.6.tgz#d9708add242a985a4d7adb597b1d661cf6b93efa"
integrity sha512-cKLzGdVKB6x3/frIu3DjMUjlLZIX3C7EAGhjXNbRvi1XbPycKYlT1Y/2ukAh69MjTXUhhER4gUdu+1rS43f70w==
dependencies:
"@jest/transform" "^29.3.1"
"@storybook/babel-plugin-require-context-hook" "1.0.1"
"@storybook/client-api" "7.6.6"
"@storybook/core-common" "7.6.6"
"@storybook/core-webpack" "7.6.6"
"@storybook/global" "^5.0.0"
"@storybook/preview-api" "7.6.6"
"@storybook/types" "7.6.6"
"@types/jest-specific-snapshot" "^0.5.6"
glob "^10.0.0"
jest-specific-snapshot "^8.0.0"
preact-render-to-string "^5.1.19"
pretty-format "^29.0.0"
react-test-renderer "^16.8.0 || ^17.0.0 || ^18.0.0"
read-pkg-up "^7.0.1"
ts-dedent "^2.0.0"

"@storybook/[email protected]":
version "7.6.6"
resolved "https://registry.yarnpkg.com/@storybook/addon-toolbars/-/addon-toolbars-7.6.6.tgz#eb669ecff9035644a4d7aeab2e9e7e0f08358986"
Expand Down Expand Up @@ -5033,11 +5011,6 @@
ts-dedent "^2.0.0"
util-deprecate "^1.0.2"

"@storybook/[email protected]":
version "1.0.1"
resolved "https://registry.yarnpkg.com/@storybook/babel-plugin-require-context-hook/-/babel-plugin-require-context-hook-1.0.1.tgz#0a4ec9816f6c7296ebc97dd8de3d2b7ae76f2e26"
integrity sha512-WM4vjgSVi8epvGiYfru7BtC3f0tGwNs7QK3Uc4xQn4t5hHQvISnCqbNrHdDYmNW56Do+bBztE8SwP6NGUvd7ww==

"@storybook/[email protected]":
version "7.6.6"
resolved "https://registry.yarnpkg.com/@storybook/blocks/-/blocks-7.6.6.tgz#19bde920298b16ac31525ae321f15912f102fe8c"
Expand Down Expand Up @@ -5190,14 +5163,6 @@
ts-dedent "^2.0.0"
util-deprecate "^1.0.2"

"@storybook/[email protected]":
version "7.6.6"
resolved "https://registry.yarnpkg.com/@storybook/client-api/-/client-api-7.6.6.tgz#571f63c841a44faa0a6566549fede3f75f0d80b0"
integrity sha512-pMWPmveJ5CJ4FgG/5Z69Ahvdi5JI5I+fooTazcTGImjxDeixoffbNrB0a6Sb5zT16gR6uKd6tywXOeV4C8uAaA==
dependencies:
"@storybook/client-logger" "7.6.6"
"@storybook/preview-api" "7.6.6"

"@storybook/[email protected]":
version "6.5.16"
resolved "https://registry.yarnpkg.com/@storybook/client-logger/-/client-logger-6.5.16.tgz#955cc46b389e7151c9eb1585a75e6a0605af61a1"
Expand Down Expand Up @@ -5404,17 +5369,6 @@
watchpack "^2.2.0"
ws "^8.2.3"

"@storybook/[email protected]":
version "7.6.6"
resolved "https://registry.yarnpkg.com/@storybook/core-webpack/-/core-webpack-7.6.6.tgz#119f5f7b565409161f00544046993106a4682992"
integrity sha512-VQyA6nb7K5uAWp/bqntW9Dtv2mVQWOp99v52ilHI/aCR9gEIC2XKBB7PTs/l5L9PKTcES6UJTcFJmOp+s7kFOA==
dependencies:
"@storybook/core-common" "7.6.6"
"@storybook/node-logger" "7.6.6"
"@storybook/types" "7.6.6"
"@types/node" "^18.0.0"
ts-dedent "^2.0.0"

"@storybook/[email protected]":
version "7.6.6"
resolved "https://registry.yarnpkg.com/@storybook/csf-plugin/-/csf-plugin-7.6.6.tgz#3420003d78921bfc974b372eb7d07a91ef416eb0"
Expand Down Expand Up @@ -6009,21 +5963,6 @@
dependencies:
"@types/istanbul-lib-report" "*"

"@types/jest-specific-snapshot@^0.5.6":
version "0.5.6"
resolved "https://registry.yarnpkg.com/@types/jest-specific-snapshot/-/jest-specific-snapshot-0.5.6.tgz#ce47102408981649a6fb1a57ee8062adb5591eac"
integrity sha512-AQdUbEyTwO6JR2yZK7PTXDzK32AlkviDZJZEukZnrZtBjITYBtExFh59HTNTZeFSs+k1b1bqCHmWUwj3VHeh/A==
dependencies:
"@types/jest" "*"

"@types/jest@*":
version "29.5.3"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.3.tgz#7a35dc0044ffb8b56325c6802a4781a626b05777"
integrity sha512-1Nq7YrO/vJE/FYnqYyw0FS8LdrjExSgIiHyKg7xPpn+yi8Q4huZryKnkJatN1ZRH89Kw2v33/8ZMB7DuZeSLlA==
dependencies:
expect "^29.0.0"
pretty-format "^29.0.0"

"@types/[email protected]":
version "29.4.0"
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.4.0.tgz#a8444ad1704493e84dbf07bb05990b275b3b9206"
Expand Down Expand Up @@ -11369,7 +11308,7 @@ jest-runtime@^29.6.2:
slash "^3.0.0"
strip-bom "^4.0.0"

jest-snapshot@^29.0.0, jest-snapshot@^29.6.2:
jest-snapshot@^29.6.2:
version "29.6.2"
resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.6.2.tgz#9b431b561a83f2bdfe041e1cab8a6becdb01af9c"
integrity sha512-1OdjqvqmRdGNvWXr/YZHuyhh5DeaLp1p/F8Tht/MrMw4Kr1Uu/j4lRG+iKl1DAqUJDWxtQBMk41Lnf/JETYBRA==
Expand All @@ -11395,13 +11334,6 @@ jest-snapshot@^29.0.0, jest-snapshot@^29.6.2:
pretty-format "^29.6.2"
semver "^7.5.3"

jest-specific-snapshot@^8.0.0:
version "8.0.0"
resolved "https://registry.yarnpkg.com/jest-specific-snapshot/-/jest-specific-snapshot-8.0.0.tgz#c80af21dcd95b6c46b73f71618f887ef3825a44c"
integrity sha512-PjK0cqPbN3ZGU1pdP78YBEFMsS1AsV28hIHg249E0v/bTtGAJqDm7lNDLj0Cs0O26P2sulbXbgEQU9xLm34WmA==
dependencies:
jest-snapshot "^29.0.0"

jest-util@^29.5.0, jest-util@^29.6.2:
version "29.6.2"
resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.6.2.tgz#8a052df8fff2eebe446769fd88814521a517664d"
Expand Down Expand Up @@ -12968,13 +12900,6 @@ postcss@^8.4.23:
picocolors "^1.0.0"
source-map-js "^1.0.2"

preact-render-to-string@^5.1.19:
version "5.2.6"
resolved "https://registry.yarnpkg.com/preact-render-to-string/-/preact-render-to-string-5.2.6.tgz#0ff0c86cd118d30affb825193f18e92bd59d0604"
integrity sha512-JyhErpYOvBV1hEPwIxc/fHWXPfnEGdRKxc8gFdAZ7XV4tlzyzG847XAyEZqoDnynP88akM4eaHcSOzNcLWFguw==
dependencies:
pretty-format "^3.8.0"

prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
Expand Down Expand Up @@ -13015,11 +12940,6 @@ pretty-format@^29.0.0, pretty-format@^29.6.2:
ansi-styles "^5.0.0"
react-is "^18.0.0"

pretty-format@^3.8.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-3.8.0.tgz#bfbed56d5e9a776645f4b1ff7aa1a3ac4fa3c385"
integrity sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==

pretty-hrtime@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz#b7e3ea42435a4c9b2759d99e0f201eb195802ee1"
Expand Down Expand Up @@ -13684,16 +13604,16 @@ react-is@^16.12.0, react-is@^16.13.1, react-is@^16.7.0, react-is@^16.8.6:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==

"react-is@^16.12.0 || ^17.0.0 || ^18.0.0", react-is@^18.0.0, react-is@^18.0.1, react-is@^18.2.0:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==

react-is@^17.0.1:
version "17.0.2"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-is@^18.0.0, react-is@^18.0.1:
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.2.0.tgz#199431eeaaa2e09f86427efbb4f1473edb47609b"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==

react-keyed-flatten-children@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/react-keyed-flatten-children/-/react-keyed-flatten-children-1.3.0.tgz#38d171582c6358909f430648a7a7d094aebae42a"
Expand Down Expand Up @@ -13754,14 +13674,6 @@ [email protected]:
dependencies:
"@remix-run/router" "1.9.0"

react-shallow-renderer@^16.15.0:
version "16.15.0"
resolved "https://registry.yarnpkg.com/react-shallow-renderer/-/react-shallow-renderer-16.15.0.tgz#48fb2cf9b23d23cde96708fe5273a7d3446f4457"
integrity sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==
dependencies:
object-assign "^4.1.1"
react-is "^16.12.0 || ^17.0.0 || ^18.0.0"

[email protected]:
version "1.1.1"
resolved "https://registry.yarnpkg.com/react-string-replace/-/react-string-replace-1.1.1.tgz#8413a598c60e397fe77df3464f2889f00ba25989"
Expand All @@ -13776,15 +13688,6 @@ react-style-singleton@^2.2.1:
invariant "^2.2.4"
tslib "^2.0.0"

"react-test-renderer@^16.8.0 || ^17.0.0 || ^18.0.0":
version "18.2.0"
resolved "https://registry.yarnpkg.com/react-test-renderer/-/react-test-renderer-18.2.0.tgz#1dd912bd908ff26da5b9fca4fd1c489b9523d37e"
integrity sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==
dependencies:
react-is "^18.2.0"
react-shallow-renderer "^16.15.0"
scheduler "^0.23.0"

react-transition-group@^4.4.1, react-transition-group@^4.4.5:
version "4.4.5"
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1"
Expand Down

0 comments on commit 6c7a38d

Please sign in to comment.