Skip to content

Commit

Permalink
bring testing-lib to future npm tag
Browse files Browse the repository at this point in the history
  • Loading branch information
yannbf committed Jun 19, 2023
1 parent 71f73b4 commit 2c05d05
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 69 deletions.
2 changes: 1 addition & 1 deletion code/addons/interactions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
40 changes: 20 additions & 20 deletions code/addons/interactions/template/stories/basics.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
// });
// },
// };
2 changes: 1 addition & 1 deletion code/lib/cli/src/generators/baseGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
);
}

Expand Down
2 changes: 1 addition & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:*",
Expand Down
37 changes: 13 additions & 24 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:*"
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion scripts/tasks/sandbox-parts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
49 changes: 29 additions & 20 deletions scripts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 2c05d05

Please sign in to comment.