diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 6e5292f49ab9..22947391e884 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -89,7 +89,7 @@ "devDependencies": { "@devtools-ds/object-inspector": "^1.1.2", "@storybook/jest": "future", - "@storybook/testing-library": "0.1.1--canary.958fe40.0", + "@storybook/testing-library": "future", "@types/node": "^16.0.0", "formik": "^2.2.9", "typescript": "~4.9.3" diff --git a/code/addons/interactions/template/stories/basics.stories.ts b/code/addons/interactions/template/stories/basics.stories.ts index 774ee5b07d8a..d250cac7f686 100644 --- a/code/addons/interactions/template/stories/basics.stories.ts +++ b/code/addons/interactions/template/stories/basics.stories.ts @@ -97,23 +97,23 @@ export const Validation = { }, }; -export const UserEventSetup = { - play: async (context) => { - const { args, canvasElement, step } = context; - const user = userEvent.setup(); - const canvas = within(canvasElement); - await step('Select, type and paste on input using user-event v14 setup', async () => { - const input = await canvas.getByRole('textbox'); - await user.click(input); - await user.type(input, 'Pasting: '); - await user.paste('foobar'); - }); - await step('Tab and press enter on submit button', async () => { - await user.tab(); - await user.keyboard('{enter}'); - const submitButton = await canvas.findByRole('button'); - await expect(submitButton).toHaveFocus(); - await expect(args.onSuccess).toHaveBeenCalled(); - }); - }, -}; +// export const UserEventSetup = { +// play: async (context) => { +// const { args, canvasElement, step } = context; +// const user = userEvent.setup(); +// const canvas = within(canvasElement); +// await step('Select, type and paste on input using user-event v14 setup', async () => { +// const input = await canvas.getByRole('textbox'); +// await user.click(input); +// await user.type(input, 'Pasting: '); +// await user.paste('foobar'); +// }); +// await step('Tab and press enter on submit button', async () => { +// await user.tab(); +// await user.keyboard('{enter}'); +// const submitButton = await canvas.findByRole('button'); +// await expect(submitButton).toHaveFocus(); +// await expect(args.onSuccess).toHaveBeenCalled(); +// }); +// }, +// }; diff --git a/code/lib/cli/src/generators/baseGenerator.ts b/code/lib/cli/src/generators/baseGenerator.ts index 76fd8231a6c3..a69fb1fe3948 100644 --- a/code/lib/cli/src/generators/baseGenerator.ts +++ b/code/lib/cli/src/generators/baseGenerator.ts @@ -246,7 +246,7 @@ export async function baseGenerator( addons.push('@storybook/addon-interactions'); addonPackages.push( '@storybook/addon-interactions', - '@storybook/testing-library@0.1.1--canary.958fe40.0' + '@storybook/testing-library@0.2.0-future.1' ); } diff --git a/code/package.json b/code/package.json index babe3f7dd3cf..6dfd66866ed3 100644 --- a/code/package.json +++ b/code/package.json @@ -184,7 +184,7 @@ "@storybook/svelte": "workspace:*", "@storybook/svelte-webpack5": "workspace:*", "@storybook/telemetry": "workspace:*", - "@storybook/testing-library": "0.1.1--canary.958fe40.0", + "@storybook/testing-library": "future", "@storybook/theming": "workspace:*", "@storybook/types": "workspace:*", "@storybook/vue": "workspace:*", diff --git a/code/yarn.lock b/code/yarn.lock index 81c89fc41e17..a54dc917067b 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5321,7 +5321,7 @@ __metadata: "@storybook/jest": future "@storybook/manager-api": 7.1.0-alpha.36 "@storybook/preview-api": 7.1.0-alpha.36 - "@storybook/testing-library": 0.1.1--canary.958fe40.0 + "@storybook/testing-library": future "@storybook/theming": 7.1.0-alpha.36 "@storybook/types": 7.1.0-alpha.36 "@types/node": ^16.0.0 @@ -6077,7 +6077,7 @@ __metadata: languageName: unknown linkType: soft -"@storybook/client-logger@npm:7.1.0-alpha.29, @storybook/client-logger@npm:future": +"@storybook/client-logger@npm:7.1.0-alpha.29": version: 7.1.0-alpha.29 resolution: "@storybook/client-logger@npm:7.1.0-alpha.29" dependencies: @@ -7216,7 +7216,7 @@ __metadata: "@storybook/svelte": "workspace:*" "@storybook/svelte-webpack5": "workspace:*" "@storybook/telemetry": "workspace:*" - "@storybook/testing-library": 0.1.1--canary.958fe40.0 + "@storybook/testing-library": future "@storybook/theming": "workspace:*" "@storybook/types": "workspace:*" "@storybook/vue": "workspace:*" @@ -7485,16 +7485,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/testing-library@npm:0.1.1--canary.958fe40.0": - version: 0.1.1--canary.958fe40.0 - resolution: "@storybook/testing-library@npm:0.1.1--canary.958fe40.0" +"@storybook/testing-library@npm:future": + version: 0.2.0-future.0 + resolution: "@storybook/testing-library@npm:0.2.0-future.0" dependencies: - "@storybook/client-logger": future - "@storybook/instrumenter": future - "@testing-library/dom": ^9.3.1 - "@testing-library/user-event": ^14.4.3 + "@testing-library/dom": ^8.3.0 + "@testing-library/user-event": ^13.2.1 ts-dedent: ^2.2.0 - checksum: 49daf6346c0372b0daed589547558153ec43fe26b440c98bb3f987cd178a0771b84596ef4357dfe3f270f54f8f540d31bdcd145cc485a6d5293508b61b462875 + checksum: 5327898a2effe0a55877c54b5dc80c5db664f62b5f4c56693cbd1ee9665b02300839280cdd1b5f1d715fff89063462c8d23b873f67bc6c06b8599cde10c52059 languageName: node linkType: hard @@ -7947,9 +7945,9 @@ __metadata: languageName: node linkType: hard -"@testing-library/dom@npm:^9.3.1": - version: 9.3.1 - resolution: "@testing-library/dom@npm:9.3.1" +"@testing-library/dom@npm:^8.3.0": + version: 8.20.1 + resolution: "@testing-library/dom@npm:8.20.1" dependencies: "@babel/code-frame": ^7.10.4 "@babel/runtime": ^7.12.5 @@ -7959,7 +7957,7 @@ __metadata: dom-accessibility-api: ^0.5.9 lz-string: ^1.5.0 pretty-format: ^27.0.2 - checksum: 25d1deddba014c107fd9703181fbb7063ed376d3ad42d7918ee752e7e677edfb5abaf672b22afc5257ffe760c9c7e5cc981656297c328bc61578d23c6b65b4dc + checksum: 614013756706467f2a7f3f693c18377048c210ec809884f0f9be866f7d865d075805ad15f5d100e8a699467fdde09085bf79e23a00ea0a6ab001d9583ef15e5d languageName: node linkType: hard @@ -8004,15 +8002,6 @@ __metadata: languageName: node linkType: hard -"@testing-library/user-event@npm:^14.4.3": - version: 14.4.3 - resolution: "@testing-library/user-event@npm:14.4.3" - peerDependencies: - "@testing-library/dom": ">=7.21.4" - checksum: 28e1e4ed2fdaa9486e203c6789386be228e305abd3fa41f38c828af415fd4a4e80f4de88de0e502ff11c4b4926f221b874a2a45bcc8170d30714e12dad2c1bd0 - languageName: node - linkType: hard - "@tootallnate/once@npm:2": version: 2.0.0 resolution: "@tootallnate/once@npm:2.0.0" diff --git a/scripts/package.json b/scripts/package.json index 3f9cf030f8c8..17efd063c107 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -72,7 +72,7 @@ "@storybook/eslint-config-storybook": "^3.1.2", "@storybook/jest": "future", "@storybook/linter-config": "^3.1.2", - "@storybook/testing-library": "0.1.1--canary.958fe40.0", + "@storybook/testing-library": "future", "@swc/core": "^1.3.23", "@testing-library/dom": "^9.3.0", "@testing-library/jest-dom": "^5.11.9", diff --git a/scripts/tasks/sandbox-parts.ts b/scripts/tasks/sandbox-parts.ts index 58fe4402e475..65b88986777b 100644 --- a/scripts/tasks/sandbox-parts.ts +++ b/scripts/tasks/sandbox-parts.ts @@ -353,7 +353,7 @@ async function addExtraDependencies({ // web-components doesn't install '@storybook/testing-library' by default const extraDeps = [ '@storybook/jest@future', - '@storybook/testing-library@0.1.1--canary.958fe40.0', + '@storybook/testing-library@future', '@storybook/test-runner@future', ]; if (debug) logger.log('🎁 Adding extra deps', extraDeps); diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 799cea76ffe2..874e4e74b3d9 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -2803,7 +2803,7 @@ __metadata: languageName: node linkType: hard -"@storybook/client-logger@npm:7.1.0-alpha.29, @storybook/client-logger@npm:future": +"@storybook/client-logger@npm:7.1.0-alpha.29": version: 7.1.0-alpha.29 resolution: "@storybook/client-logger@npm:7.1.0-alpha.29" dependencies: @@ -2960,7 +2960,7 @@ __metadata: "@storybook/eslint-config-storybook": ^3.1.2 "@storybook/jest": future "@storybook/linter-config": ^3.1.2 - "@storybook/testing-library": 0.1.1--canary.958fe40.0 + "@storybook/testing-library": future "@swc/core": ^1.3.23 "@testing-library/dom": ^9.3.0 "@testing-library/jest-dom": ^5.11.9 @@ -3080,16 +3080,14 @@ __metadata: languageName: unknown linkType: soft -"@storybook/testing-library@npm:0.1.1--canary.958fe40.0": - version: 0.1.1--canary.958fe40.0 - resolution: "@storybook/testing-library@npm:0.1.1--canary.958fe40.0" +"@storybook/testing-library@npm:future": + version: 0.2.0-future.0 + resolution: "@storybook/testing-library@npm:0.2.0-future.0" dependencies: - "@storybook/client-logger": future - "@storybook/instrumenter": future - "@testing-library/dom": ^9.3.1 - "@testing-library/user-event": ^14.4.3 + "@testing-library/dom": ^8.3.0 + "@testing-library/user-event": ^13.2.1 ts-dedent: ^2.2.0 - checksum: 49daf6346c0372b0daed589547558153ec43fe26b440c98bb3f987cd178a0771b84596ef4357dfe3f270f54f8f540d31bdcd145cc485a6d5293508b61b462875 + checksum: 5327898a2effe0a55877c54b5dc80c5db664f62b5f4c56693cbd1ee9665b02300839280cdd1b5f1d715fff89063462c8d23b873f67bc6c06b8599cde10c52059 languageName: node linkType: hard @@ -3235,35 +3233,35 @@ __metadata: languageName: node linkType: hard -"@testing-library/dom@npm:^9.0.0, @testing-library/dom@npm:^9.3.0": - version: 9.3.0 - resolution: "@testing-library/dom@npm:9.3.0" +"@testing-library/dom@npm:^8.3.0": + version: 8.20.1 + resolution: "@testing-library/dom@npm:8.20.1" dependencies: "@babel/code-frame": ^7.10.4 "@babel/runtime": ^7.12.5 "@types/aria-query": ^5.0.1 - aria-query: ^5.0.0 + aria-query: 5.1.3 chalk: ^4.1.0 dom-accessibility-api: ^0.5.9 lz-string: ^1.5.0 pretty-format: ^27.0.2 - checksum: c5f9b6cf6ddf31e4556961d5ec8a6d700b953df3181860355e9506efe8825d40952286ab392b2f6aeb5cbaebf2f022562ef168c34f730f88d7c977e63ac41d82 + checksum: 614013756706467f2a7f3f693c18377048c210ec809884f0f9be866f7d865d075805ad15f5d100e8a699467fdde09085bf79e23a00ea0a6ab001d9583ef15e5d languageName: node linkType: hard -"@testing-library/dom@npm:^9.3.1": - version: 9.3.1 - resolution: "@testing-library/dom@npm:9.3.1" +"@testing-library/dom@npm:^9.0.0, @testing-library/dom@npm:^9.3.0": + version: 9.3.0 + resolution: "@testing-library/dom@npm:9.3.0" dependencies: "@babel/code-frame": ^7.10.4 "@babel/runtime": ^7.12.5 "@types/aria-query": ^5.0.1 - aria-query: 5.1.3 + aria-query: ^5.0.0 chalk: ^4.1.0 dom-accessibility-api: ^0.5.9 lz-string: ^1.5.0 pretty-format: ^27.0.2 - checksum: 25d1deddba014c107fd9703181fbb7063ed376d3ad42d7918ee752e7e677edfb5abaf672b22afc5257ffe760c9c7e5cc981656297c328bc61578d23c6b65b4dc + checksum: c5f9b6cf6ddf31e4556961d5ec8a6d700b953df3181860355e9506efe8825d40952286ab392b2f6aeb5cbaebf2f022562ef168c34f730f88d7c977e63ac41d82 languageName: node linkType: hard @@ -3298,6 +3296,17 @@ __metadata: languageName: node linkType: hard +"@testing-library/user-event@npm:^13.2.1": + version: 13.5.0 + resolution: "@testing-library/user-event@npm:13.5.0" + dependencies: + "@babel/runtime": ^7.12.5 + peerDependencies: + "@testing-library/dom": ">=7.21.4" + checksum: ff57edaeab31322c80c3f01d55404b4cebb907b9ec7672b96a1a14d053f172046b01c5f27b45677927ebee8ed91bce695a7d09edec9a48875cfacabe39d0426a + languageName: node + linkType: hard + "@testing-library/user-event@npm:^14.4.3": version: 14.4.3 resolution: "@testing-library/user-event@npm:14.4.3"