From d3087816c0fcbcbfac1a92682f03c5fa027676a2 Mon Sep 17 00:00:00 2001 From: Valentin Palkovic Date: Mon, 3 Mar 2025 21:40:10 +0100 Subject: [PATCH] Rename @storybook/test to storybook/test --- code/.storybook/storybook.setup.ts | 3 +- .../a11y/src/components/A11YPanel.stories.tsx | 2 +- .../TestDiscrepancyMessage.stories.tsx | 2 +- code/addons/a11y/src/preview.tsx | 2 +- code/addons/actions/src/loaders.ts | 3 +- .../actions/template/stories/spies.stories.ts | 2 +- .../addons/controls/src/SaveStory.stories.tsx | 3 +- .../stories/docs2/resolved-react.stories.ts | 2 +- .../stories/docspage/autoplay.stories.ts | 2 +- .../stories/docspage/basic.stories.ts | 2 +- code/addons/interactions/README.md | 6 +- .../src/components/Interaction.stories.tsx | 3 +- .../components/InteractionsPanel.stories.tsx | 3 +- .../template/stories/basics.stories.ts | 3 +- .../stories/unhandled-errors.stories.ts | 3 +- .../HighlightElement.stories.tsx | 3 +- .../src/components/List/List.stories.tsx | 3 +- .../GuidedTour/GuidedTour.stories.tsx | 3 +- .../components/GlobalErrorModal.stories.tsx | 2 +- .../src/components/Interaction.stories.tsx | 3 +- .../components/InteractionsPanel.stories.tsx | 3 +- .../TestDiscrepancyMessage.stories.tsx | 3 +- .../components/TestProviderRender.stories.tsx | 3 +- code/addons/test/src/manager-store.mock.ts | 2 +- .../test/template/stories/basics.stories.ts | 2 +- .../stories/unhandled-errors.stories.ts | 2 +- .../template/stories/parameters.stories.ts | 2 +- code/core/package.json | 4 + code/core/src/common/versions.ts | 1 - .../components/Modal/Modal.stories.tsx | 3 +- .../components/tabs/tabs.stories.tsx | 5 +- .../tooltip/WithTooltip.stories.tsx | 3 +- .../components/layout/Layout.stories.tsx | 3 +- .../mobile/about/MobileAbout.stories.tsx | 3 +- .../navigation/MobileNavigation.stories.tsx | 2 +- .../NotificationItem.stories.tsx | 3 +- .../sidebar/FileSearchList.stories.tsx | 3 +- .../sidebar/FileSearchModal.stories.tsx | 3 +- .../sidebar/FilterToggle.stories.ts | 2 +- .../components/sidebar/Heading.stories.tsx | 3 +- .../components/sidebar/Menu.stories.tsx | 3 +- .../components/sidebar/Refs.stories.tsx | 2 +- .../components/sidebar/Sidebar.stories.tsx | 3 +- .../sidebar/SidebarBottom.stories.tsx | 3 +- .../components/sidebar/TagsFilter.stories.tsx | 3 +- .../sidebar/TagsFilterPanel.stories.tsx | 3 +- .../sidebar/TestingModule.stories.tsx | 3 +- .../components/sidebar/Tree.stories.tsx | 3 +- .../upgrade/UpgradeBlock.stories.tsx | 3 +- .../src/manager/settings/about.stories.tsx | 3 +- code/core/src/preview-errors.ts | 2 +- code/core/src/shared/universal-store/mock.ts | 2 +- code/core/src/test/index.test.ts | 4 +- .../template/stories/argMapping.stories.ts | 2 +- .../core/template/stories/argTypes.stories.ts | 2 +- code/core/template/stories/args.stories.ts | 2 +- .../template/stories/autotitle.stories.ts | 2 +- .../template/stories/before-each.stories.ts | 2 +- .../stories/component-play.stories.ts | 2 +- .../template/stories/decorators.stories.ts | 2 +- .../destructuring-not-transpiled.stories.ts | 2 +- code/core/template/stories/globals.stories.ts | 2 +- code/core/template/stories/hooks.stories.ts | 2 +- code/core/template/stories/indexer.stories.ts | 2 +- .../stories/loader-enhancements.stories.ts | 2 +- code/core/template/stories/loaders.stories.ts | 2 +- .../stories/module-mocking.stories.ts | 2 +- .../template/stories/mount-in-play.stories.ts | 2 +- code/core/template/stories/names.stories.ts | 2 +- .../template/stories/parameters.stories.ts | 2 +- .../template/stories/rendering.stories.ts | 2 +- .../template/stories/shortcuts.stories.ts | 2 +- .../core/template/stories/tags-add.stories.ts | 2 +- .../template/stories/tags-config.stories.ts | 2 +- .../template/stories/tags-remove.stories.ts | 2 +- code/core/template/stories/title.stories.ts | 2 +- code/core/template/stories/utils.mock.ts | 2 +- .../angular/template/cli/button.stories.ts | 2 +- .../angular/template/cli/header.stories.ts | 2 +- .../angular/template/cli/page.stories.ts | 2 +- .../signal/button.stories.ts | 2 +- .../signal/button.stories.ts | 2 +- .../ember/template/cli/Button.stories.js | 3 +- .../src/export-mocks/cache/index.ts | 2 +- .../src/export-mocks/headers/cookies.ts | 3 +- .../src/export-mocks/headers/headers.ts | 3 +- .../src/export-mocks/headers/index.ts | 3 +- .../src/export-mocks/navigation/index.ts | 5 +- .../src/export-mocks/router/index.ts | 5 +- .../template/cli/js/Button.stories.js | 2 +- .../template/cli/js/Header.stories.js | 2 +- .../template/cli/js/Page.stories.js | 2 +- .../template/cli/ts-4-9/Button.stories.ts | 3 +- .../template/cli/ts-4-9/Header.stories.ts | 3 +- .../template/cli/ts-4-9/Page.stories.ts | 3 +- .../template/stories/Head.stories.tsx | 2 +- .../template/stories/Navigation.stories.tsx | 2 +- .../template/stories/NextHeader.stories.tsx | 3 +- .../template/stories/Redirect.stories.tsx | 2 +- .../template/stories/Router.stories.tsx | 2 +- .../stories/ServerActions.stories.tsx | 3 +- .../nextjs/src/export-mocks/cache/index.ts | 3 +- .../src/export-mocks/headers/cookies.ts | 2 +- .../src/export-mocks/headers/headers.ts | 3 +- .../nextjs/src/export-mocks/headers/index.ts | 3 +- .../src/export-mocks/navigation/index.ts | 5 +- .../nextjs/src/export-mocks/router/index.ts | 5 +- .../nextjs/template/cli/js/Button.stories.js | 2 +- .../nextjs/template/cli/js/Header.stories.js | 2 +- .../nextjs/template/cli/js/Page.stories.js | 2 +- .../template/cli/ts-4-9/Button.stories.ts | 3 +- .../template/cli/ts-4-9/Header.stories.ts | 3 +- .../template/cli/ts-4-9/Page.stories.ts | 3 +- .../nextjs/template/stories/Head.stories.tsx | 2 +- .../template/stories/Navigation.stories.tsx | 2 +- .../template/stories/Router.stories.tsx | 2 +- .../NextHeader.stories.tsx | 3 +- .../Redirect.stories.tsx | 2 +- .../ServerActions.stories.tsx | 3 +- .../NextHeader.stories.tsx | 3 +- .../Redirect.stories.tsx | 2 +- .../ServerActions.stories.tsx | 3 +- .../template/cli/js/Button.stories.jsx | 3 +- .../template/cli/js/Page.stories.jsx | 2 +- .../template/cli/ts-4-9/Button.stories.tsx | 2 +- .../template/cli/ts-4-9/Page.stories.tsx | 3 +- .../forms.stories.js | 2 +- .../hrefs.stories.js | 2 +- .../navigation.stories.js | 2 +- .../environment.stories.js | 2 +- .../forms.stories.js | 2 +- .../hrefs.stories.js | 2 +- .../navigation.stories.js | 2 +- .../paths.stories.js | 2 +- .../environment.stories.js | 2 +- .../forms.stories.js | 2 +- .../hrefs.stories.js | 2 +- .../navigation.stories.js | 2 +- .../paths.stories.js | 2 +- .../blocks/src/blocks/ArgTypes.stories.tsx | 3 +- .../blocks/src/blocks/Controls.stories.tsx | 3 +- code/lib/blocks/src/blocks/Story.stories.tsx | 3 +- .../blocks/src/components/Story.stories.tsx | 3 +- .../blocks/src/controls/Boolean.stories.tsx | 3 +- .../lib/blocks/src/controls/Color.stories.tsx | 3 +- code/lib/blocks/src/controls/Date.stories.tsx | 3 +- .../lib/blocks/src/controls/Files.stories.tsx | 3 +- .../blocks/src/controls/Number.stories.tsx | 3 +- .../blocks/src/controls/Object.stories.tsx | 3 +- .../lib/blocks/src/controls/Range.stories.tsx | 3 +- code/lib/blocks/src/controls/Text.stories.tsx | 3 +- .../controls/options/CheckOptions.stories.tsx | 3 +- .../controls/options/RadioOptions.stories.tsx | 3 +- .../options/SelectOptions.stories.tsx | 3 +- .../blocks/src/examples/Button.stories.tsx | 3 +- .../__tests__/migrate-to-test-package.test.ts | 10 +- .../cli/svelte-5-js/Button.stories.svelte | 2 +- .../cli/svelte-5-js/Header.stories.svelte | 2 +- .../cli/svelte-5-js/Page.stories.svelte | 4 +- .../cli/svelte-5-ts-3-8/Button.stories.svelte | 2 +- .../cli/svelte-5-ts-3-8/Header.stories.svelte | 2 +- .../cli/svelte-5-ts-3-8/Page.stories.svelte | 4 +- .../cli/svelte-5-ts-4-9/Button.stories.svelte | 2 +- .../cli/svelte-5-ts-4-9/Header.stories.svelte | 2 +- .../cli/svelte-5-ts-4-9/Page.stories.svelte | 4 +- .../composeStories/Button.stories.ts | 2 +- .../vue3/template/cli/js/Button.stories.js | 2 +- .../vue3/template/cli/js/Header.stories.js | 2 +- .../vue3/template/cli/js/Page.stories.js | 2 +- .../template/cli/ts-4-9/Button.stories.ts | 3 +- .../template/cli/ts-4-9/Header.stories.ts | 3 +- .../vue3/template/cli/ts-4-9/Page.stories.ts | 3 +- .../button-story-onclick-action-spy.md | 8 +- .../login-form-with-play-function.md | 96 +++++++++---------- .../my-component-play-function-alt-queries.md | 24 ++--- .../my-component-play-function-composition.md | 12 +-- ...my-component-play-function-query-findby.md | 24 ++--- .../my-component-play-function-waitfor.md | 24 ++--- .../my-component-play-function-with-canvas.md | 24 ++--- ...component-play-function-with-clickevent.md | 24 ++--- .../my-component-play-function-with-delay.md | 24 ++--- ...omponent-play-function-with-selectevent.md | 24 ++--- docs/_snippets/nextjs-cache-mock.md | 6 +- docs/_snippets/nextjs-headers-mock.md | 6 +- docs/_snippets/nextjs-navigation-mock.md | 6 +- docs/_snippets/nextjs-router-mock.md | 6 +- .../register-component-with-play-function.md | 24 ++--- .../storybook-interactions-play-function.md | 12 +-- .../storybook-interactions-step-function.md | 12 +-- docs/_snippets/storybook-test-fn-mock-spy.md | 12 +-- .../storybook-test-mock-file-example.md | 2 +- .../mocking-modules.mdx | 2 +- .../nextjs/stories/Head.stories.tsx | 2 +- .../nextjs/stories/Navigation.stories.tsx | 2 +- .../nextjs/stories/NextHeader.stories.tsx | 2 +- .../nextjs/stories/Router.stories.tsx | 2 +- .../react/stories/AddonTest.stories.tsx | 2 +- .../react/stories/Button.stories.tsx | 2 +- .../svelte/stories/Button.stories.ts | 2 +- .../vue3/stories/Button.stories.ts | 2 +- 200 files changed, 447 insertions(+), 392 deletions(-) diff --git a/code/.storybook/storybook.setup.ts b/code/.storybook/storybook.setup.ts index 80160218a31..833e21c50ac 100644 --- a/code/.storybook/storybook.setup.ts +++ b/code/.storybook/storybook.setup.ts @@ -1,7 +1,8 @@ import { beforeAll, vi, expect as vitestExpect } from 'vitest'; import { setProjectAnnotations } from '@storybook/react'; -import { userEvent as storybookEvent, expect as storybookExpect } from '@storybook/test'; + +import { userEvent as storybookEvent, expect as storybookExpect } from 'storybook/test'; import preview from './preview'; diff --git a/code/addons/a11y/src/components/A11YPanel.stories.tsx b/code/addons/a11y/src/components/A11YPanel.stories.tsx index 701b5a50933..25c0d5ec18a 100644 --- a/code/addons/a11y/src/components/A11YPanel.stories.tsx +++ b/code/addons/a11y/src/components/A11YPanel.stories.tsx @@ -4,9 +4,9 @@ import { ManagerContext } from 'storybook/internal/manager-api'; import { ThemeProvider, convert, themes } from 'storybook/internal/theming'; import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; import type axe from 'axe-core'; +import { fn } from 'storybook/test'; import { A11YPanel } from './A11YPanel'; import { A11yContext } from './A11yContext'; diff --git a/code/addons/a11y/src/components/TestDiscrepancyMessage.stories.tsx b/code/addons/a11y/src/components/TestDiscrepancyMessage.stories.tsx index 578c2bbac79..f943064e008 100644 --- a/code/addons/a11y/src/components/TestDiscrepancyMessage.stories.tsx +++ b/code/addons/a11y/src/components/TestDiscrepancyMessage.stories.tsx @@ -3,7 +3,7 @@ import React from 'react'; import { ManagerContext } from 'storybook/internal/manager-api'; import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import { TestDiscrepancyMessage } from './TestDiscrepancyMessage'; diff --git a/code/addons/a11y/src/preview.tsx b/code/addons/a11y/src/preview.tsx index 9b8a7598d6d..cd1e4f9297b 100644 --- a/code/addons/a11y/src/preview.tsx +++ b/code/addons/a11y/src/preview.tsx @@ -1,6 +1,6 @@ import type { AfterEach } from 'storybook/internal/types'; -import { expect } from '@storybook/test'; +import { expect } from 'storybook/test'; import { run } from './a11yRunner'; import type { A11yParameters } from './params'; diff --git a/code/addons/actions/src/loaders.ts b/code/addons/actions/src/loaders.ts index 118d5c0b1b7..60202ec3692 100644 --- a/code/addons/actions/src/loaders.ts +++ b/code/addons/actions/src/loaders.ts @@ -2,7 +2,8 @@ import type { LoaderFunction } from 'storybook/internal/types'; import { global } from '@storybook/global'; -import type { onMockCall as onMockCallType } from '@storybook/test'; + +import type { onMockCall as onMockCallType } from 'storybook/test'; import { action } from './runtime'; diff --git a/code/addons/actions/template/stories/spies.stories.ts b/code/addons/actions/template/stories/spies.stories.ts index 9d84cae3d36..f731b17abe8 100644 --- a/code/addons/actions/template/stories/spies.stories.ts +++ b/code/addons/actions/template/stories/spies.stories.ts @@ -1,5 +1,5 @@ import { global as globalThis } from '@storybook/global'; -import { spyOn } from '@storybook/test'; +import { spyOn } from 'storybook/test'; const meta = { component: globalThis.Components.Button, diff --git a/code/addons/controls/src/SaveStory.stories.tsx b/code/addons/controls/src/SaveStory.stories.tsx index 9c39f6746e0..f367762e3a5 100644 --- a/code/addons/controls/src/SaveStory.stories.tsx +++ b/code/addons/controls/src/SaveStory.stories.tsx @@ -1,10 +1,11 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, fireEvent, fn, userEvent, within } from '@storybook/test'; import { action } from '@storybook/addon-actions'; +import { expect, fireEvent, fn, userEvent, within } from 'storybook/test'; + import { SaveStory } from './SaveStory'; const meta = { diff --git a/code/addons/docs/template/stories/docs2/resolved-react.stories.ts b/code/addons/docs/template/stories/docs2/resolved-react.stories.ts index 75e3d480ca9..43564cf4638 100644 --- a/code/addons/docs/template/stories/docs2/resolved-react.stories.ts +++ b/code/addons/docs/template/stories/docs2/resolved-react.stories.ts @@ -2,7 +2,7 @@ import * as ReactExport from 'react'; import * as ReactDom from 'react-dom'; import * as ReactDomServer from 'react-dom/server'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; /** * This component is used to display the resolved version of React and its related packages. As long diff --git a/code/addons/docs/template/stories/docspage/autoplay.stories.ts b/code/addons/docs/template/stories/docspage/autoplay.stories.ts index 03d1388f2fb..e96aeeaf417 100644 --- a/code/addons/docs/template/stories/docspage/autoplay.stories.ts +++ b/code/addons/docs/template/stories/docspage/autoplay.stories.ts @@ -1,4 +1,4 @@ -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/addons/docs/template/stories/docspage/basic.stories.ts b/code/addons/docs/template/stories/docspage/basic.stories.ts index a9ea37650fc..a21d7ab3675 100644 --- a/code/addons/docs/template/stories/docspage/basic.stories.ts +++ b/code/addons/docs/template/stories/docspage/basic.stories.ts @@ -1,4 +1,4 @@ -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; export default { component: globalThis.Components.Button, diff --git a/code/addons/interactions/README.md b/code/addons/interactions/README.md index 8e97267a65d..bd6895851cc 100644 --- a/code/addons/interactions/README.md +++ b/code/addons/interactions/README.md @@ -9,7 +9,7 @@ Storybook Addon Interactions enables visual debugging of interactions and tests Install this addon by adding the `@storybook/addon-interactions` dependency: ```sh -yarn add -D @storybook/addon-interactions @storybook/test +yarn add -D @storybook/addon-interactions ``` within `.storybook/main.js`: @@ -24,10 +24,10 @@ Note that `@storybook/addon-interactions` must be listed **after** `@storybook/a ## Usage -Interactions relies on "instrumented" versions of Vitest and Testing Library, that you import from `@storybook/test` instead of their original package. You can then use these libraries in your `play` function. +Interactions relies on "instrumented" versions of Vitest and Testing Library, that you import from `storybook/test` instead of their original package. You can then use these libraries in your `play` function. ```js -import { expect, fn, userEvent, within } from '@storybook/test'; +import { expect, fn, userEvent, within } from 'storybook/test'; import { Button } from './Button'; export default { diff --git a/code/addons/interactions/src/components/Interaction.stories.tsx b/code/addons/interactions/src/components/Interaction.stories.tsx index 64f43a8cef7..09aae3e2544 100644 --- a/code/addons/interactions/src/components/Interaction.stories.tsx +++ b/code/addons/interactions/src/components/Interaction.stories.tsx @@ -1,7 +1,8 @@ import { CallStates } from 'storybook/internal/instrumenter'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; + +import { expect, userEvent, within } from 'storybook/test'; import { getCalls } from '../mocks'; import { Interaction } from './Interaction'; diff --git a/code/addons/interactions/src/components/InteractionsPanel.stories.tsx b/code/addons/interactions/src/components/InteractionsPanel.stories.tsx index 8d6d7cd9f3f..22be7f9666d 100644 --- a/code/addons/interactions/src/components/InteractionsPanel.stories.tsx +++ b/code/addons/interactions/src/components/InteractionsPanel.stories.tsx @@ -4,7 +4,8 @@ import { CallStates } from 'storybook/internal/instrumenter'; import { styled } from 'storybook/internal/theming'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, waitFor, within } from '@storybook/test'; + +import { expect, userEvent, waitFor, within } from 'storybook/test'; import { isChromatic } from '../../../../.storybook/isChromatic'; import { getCalls, getInteractions } from '../mocks'; diff --git a/code/addons/interactions/template/stories/basics.stories.ts b/code/addons/interactions/template/stories/basics.stories.ts index 2db5f0e016f..a1cb4ce7d41 100644 --- a/code/addons/interactions/template/stories/basics.stories.ts +++ b/code/addons/interactions/template/stories/basics.stories.ts @@ -1,4 +1,5 @@ import { global as globalThis } from '@storybook/global'; + import { expect, fireEvent, @@ -7,7 +8,7 @@ import { waitFor, waitForElementToBeRemoved, within, -} from '@storybook/test'; +} from 'storybook/test'; export default { component: globalThis.Components.Form, diff --git a/code/addons/interactions/template/stories/unhandled-errors.stories.ts b/code/addons/interactions/template/stories/unhandled-errors.stories.ts index b9be0df743e..d5c396b7168 100644 --- a/code/addons/interactions/template/stories/unhandled-errors.stories.ts +++ b/code/addons/interactions/template/stories/unhandled-errors.stories.ts @@ -1,5 +1,6 @@ import { global as globalThis } from '@storybook/global'; -import { userEvent, within } from '@storybook/test'; + +import { userEvent, within } from 'storybook/test'; export default { component: globalThis.Components.Button, diff --git a/code/addons/onboarding/src/components/HighlightElement/HighlightElement.stories.tsx b/code/addons/onboarding/src/components/HighlightElement/HighlightElement.stories.tsx index 7cb0c52b011..76061b41629 100644 --- a/code/addons/onboarding/src/components/HighlightElement/HighlightElement.stories.tsx +++ b/code/addons/onboarding/src/components/HighlightElement/HighlightElement.stories.tsx @@ -1,7 +1,8 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, waitFor, within } from '@storybook/test'; + +import { expect, waitFor, within } from 'storybook/test'; import { HighlightElement } from './HighlightElement'; diff --git a/code/addons/onboarding/src/components/List/List.stories.tsx b/code/addons/onboarding/src/components/List/List.stories.tsx index 8e7667d8a12..5d99c6ab0ad 100644 --- a/code/addons/onboarding/src/components/List/List.stories.tsx +++ b/code/addons/onboarding/src/components/List/List.stories.tsx @@ -1,7 +1,8 @@ import React, { useState } from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, waitFor, within } from '@storybook/test'; + +import { expect, userEvent, waitFor, within } from 'storybook/test'; import { List } from './List'; import { ListItem } from './ListItem/ListItem'; diff --git a/code/addons/onboarding/src/features/GuidedTour/GuidedTour.stories.tsx b/code/addons/onboarding/src/features/GuidedTour/GuidedTour.stories.tsx index c35a02830a5..a9cd25b04af 100644 --- a/code/addons/onboarding/src/features/GuidedTour/GuidedTour.stories.tsx +++ b/code/addons/onboarding/src/features/GuidedTour/GuidedTour.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { GuidedTour } from './GuidedTour'; diff --git a/code/addons/test/src/components/GlobalErrorModal.stories.tsx b/code/addons/test/src/components/GlobalErrorModal.stories.tsx index 773ff178f17..826f7a2f884 100644 --- a/code/addons/test/src/components/GlobalErrorModal.stories.tsx +++ b/code/addons/test/src/components/GlobalErrorModal.stories.tsx @@ -3,8 +3,8 @@ import React, { useState } from 'react'; import { ManagerContext } from 'storybook/internal/manager-api'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, fn, userEvent, within } from '@storybook/test'; +import { expect, fn, userEvent, within } from 'storybook/test'; import dedent from 'ts-dedent'; import { GlobalErrorContext, GlobalErrorModal } from './GlobalErrorModal'; diff --git a/code/addons/test/src/components/Interaction.stories.tsx b/code/addons/test/src/components/Interaction.stories.tsx index 64f43a8cef7..09aae3e2544 100644 --- a/code/addons/test/src/components/Interaction.stories.tsx +++ b/code/addons/test/src/components/Interaction.stories.tsx @@ -1,7 +1,8 @@ import { CallStates } from 'storybook/internal/instrumenter'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; + +import { expect, userEvent, within } from 'storybook/test'; import { getCalls } from '../mocks'; import { Interaction } from './Interaction'; diff --git a/code/addons/test/src/components/InteractionsPanel.stories.tsx b/code/addons/test/src/components/InteractionsPanel.stories.tsx index 2efaa5d96c5..e9b8c9581fb 100644 --- a/code/addons/test/src/components/InteractionsPanel.stories.tsx +++ b/code/addons/test/src/components/InteractionsPanel.stories.tsx @@ -5,7 +5,8 @@ import { ManagerContext } from 'storybook/internal/manager-api'; import { styled } from 'storybook/internal/theming'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, fn, userEvent, waitFor, within } from '@storybook/test'; + +import { expect, fn, userEvent, waitFor, within } from 'storybook/test'; import { isChromatic } from '../../../../.storybook/isChromatic'; import { getCalls, getInteractions } from '../mocks'; diff --git a/code/addons/test/src/components/TestDiscrepancyMessage.stories.tsx b/code/addons/test/src/components/TestDiscrepancyMessage.stories.tsx index d6ca6aa8320..fffdb631cdc 100644 --- a/code/addons/test/src/components/TestDiscrepancyMessage.stories.tsx +++ b/code/addons/test/src/components/TestDiscrepancyMessage.stories.tsx @@ -4,7 +4,8 @@ import { CallStates } from 'storybook/internal/instrumenter'; import { ManagerContext } from 'storybook/internal/manager-api'; import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { TestDiscrepancyMessage } from './TestDiscrepancyMessage'; diff --git a/code/addons/test/src/components/TestProviderRender.stories.tsx b/code/addons/test/src/components/TestProviderRender.stories.tsx index 40097eae1dd..385d42ed69d 100644 --- a/code/addons/test/src/components/TestProviderRender.stories.tsx +++ b/code/addons/test/src/components/TestProviderRender.stories.tsx @@ -6,7 +6,8 @@ import { styled } from 'storybook/internal/theming'; import { Addon_TypesEnum } from 'storybook/internal/types'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, fn } from '@storybook/test'; + +import { expect, fn } from 'storybook/test'; import { type Details, storeOptions } from '../constants'; import { store as mockStore } from '../manager-store.mock'; diff --git a/code/addons/test/src/manager-store.mock.ts b/code/addons/test/src/manager-store.mock.ts index 9b64e314b03..cc4d18ef510 100644 --- a/code/addons/test/src/manager-store.mock.ts +++ b/code/addons/test/src/manager-store.mock.ts @@ -1,6 +1,6 @@ import { experimental_MockUniversalStore } from 'storybook/internal/manager-api'; -import * as testUtils from '@storybook/test'; +import * as testUtils from 'storybook/test'; import { storeOptions } from './constants'; diff --git a/code/addons/test/template/stories/basics.stories.ts b/code/addons/test/template/stories/basics.stories.ts index 2db5f0e016f..87ec72a5076 100644 --- a/code/addons/test/template/stories/basics.stories.ts +++ b/code/addons/test/template/stories/basics.stories.ts @@ -7,7 +7,7 @@ import { waitFor, waitForElementToBeRemoved, within, -} from '@storybook/test'; +} from 'storybook/test'; export default { component: globalThis.Components.Form, diff --git a/code/addons/test/template/stories/unhandled-errors.stories.ts b/code/addons/test/template/stories/unhandled-errors.stories.ts index b9be0df743e..a5fed9b9a81 100644 --- a/code/addons/test/template/stories/unhandled-errors.stories.ts +++ b/code/addons/test/template/stories/unhandled-errors.stories.ts @@ -1,5 +1,5 @@ import { global as globalThis } from '@storybook/global'; -import { userEvent, within } from '@storybook/test'; +import { userEvent, within } from 'storybook/test'; export default { component: globalThis.Components.Button, diff --git a/code/addons/viewport/template/stories/parameters.stories.ts b/code/addons/viewport/template/stories/parameters.stories.ts index 697f675c214..3e607a42c49 100644 --- a/code/addons/viewport/template/stories/parameters.stories.ts +++ b/code/addons/viewport/template/stories/parameters.stories.ts @@ -1,5 +1,5 @@ import { global as globalThis } from '@storybook/global'; -import { expect } from '@storybook/test'; +import { expect } from 'storybook/test'; import { MINIMAL_VIEWPORTS } from '@storybook/addon-viewport'; diff --git a/code/core/package.json b/code/core/package.json index 7466dd601c0..0c299e6da9d 100644 --- a/code/core/package.json +++ b/code/core/package.json @@ -181,6 +181,10 @@ "import": "./dist/instrumenter/index.js", "require": "./dist/instrumenter/index.cjs" }, + "./test": { + "types": "./dist/test/index.d.ts", + "import": "./dist/test/index.js" + }, "./internal/preview/runtime": { "import": "./dist/preview/runtime.js" }, diff --git a/code/core/src/common/versions.ts b/code/core/src/common/versions.ts index dec62008fd3..8d8b0e688ca 100644 --- a/code/core/src/common/versions.ts +++ b/code/core/src/common/versions.ts @@ -50,7 +50,6 @@ export default { '@storybook/csf-plugin': '9.0.0-alpha.1', '@storybook/react-dom-shim': '9.0.0-alpha.1', '@storybook/source-loader': '9.0.0-alpha.1', - '@storybook/test': '9.0.0-alpha.1', '@storybook/preset-create-react-app': '9.0.0-alpha.1', '@storybook/preset-html-webpack': '9.0.0-alpha.1', '@storybook/preset-preact-webpack': '9.0.0-alpha.1', diff --git a/code/core/src/components/components/Modal/Modal.stories.tsx b/code/core/src/components/components/Modal/Modal.stories.tsx index 998e033d312..e0949badf68 100644 --- a/code/core/src/components/components/Modal/Modal.stories.tsx +++ b/code/core/src/components/components/Modal/Modal.stories.tsx @@ -1,7 +1,8 @@ import React, { useState } from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; + +import { expect, userEvent, within } from 'storybook/test'; import { Button } from '../Button/Button'; import { Modal } from './Modal'; diff --git a/code/core/src/components/components/tabs/tabs.stories.tsx b/code/core/src/components/components/tabs/tabs.stories.tsx index f70565a2102..c4bad39dd12 100644 --- a/code/core/src/components/components/tabs/tabs.stories.tsx +++ b/code/core/src/components/components/tabs/tabs.stories.tsx @@ -2,11 +2,12 @@ import React from 'react'; import { BottomBarIcon, CloseIcon } from '@storybook/icons'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect } from '@storybook/test'; -import { findByText, fireEvent, screen, userEvent, waitFor, within } from '@storybook/test'; import { action } from '@storybook/addon-actions'; +import { expect } from 'storybook/test'; +import { findByText, fireEvent, screen, userEvent, waitFor, within } from 'storybook/test'; + import { IconButton } from '../IconButton/IconButton'; import { TabWrapper, Tabs, TabsState } from './tabs'; import type { ChildrenList } from './tabs.helpers'; diff --git a/code/core/src/components/components/tooltip/WithTooltip.stories.tsx b/code/core/src/components/components/tooltip/WithTooltip.stories.tsx index 952dceeaf51..a5157f20e7e 100644 --- a/code/core/src/components/components/tooltip/WithTooltip.stories.tsx +++ b/code/core/src/components/components/tooltip/WithTooltip.stories.tsx @@ -4,7 +4,8 @@ import React from 'react'; import { styled } from 'storybook/internal/theming'; import type { StoryObj } from '@storybook/react'; -import { expect, screen } from '@storybook/test'; + +import { expect, screen } from 'storybook/test'; import { TooltipMessage } from './TooltipMessage'; import { WithToolTipState as WithTooltip } from './WithTooltip'; diff --git a/code/core/src/manager/components/layout/Layout.stories.tsx b/code/core/src/manager/components/layout/Layout.stories.tsx index e3f19df412d..c498a8e637e 100644 --- a/code/core/src/manager/components/layout/Layout.stories.tsx +++ b/code/core/src/manager/components/layout/Layout.stories.tsx @@ -5,10 +5,11 @@ import { LocationProvider } from 'storybook/internal/router'; import { styled } from 'storybook/internal/theming'; import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; import { action } from '@storybook/addon-actions'; +import { fn } from 'storybook/test'; + import MobileNavigationStoriesMeta from '../mobile/navigation/MobileNavigation.stories'; import { Layout } from './Layout'; import { LayoutProvider } from './LayoutProvider'; diff --git a/code/core/src/manager/components/mobile/about/MobileAbout.stories.tsx b/code/core/src/manager/components/mobile/about/MobileAbout.stories.tsx index 36759e03950..60e0ea71dce 100644 --- a/code/core/src/manager/components/mobile/about/MobileAbout.stories.tsx +++ b/code/core/src/manager/components/mobile/about/MobileAbout.stories.tsx @@ -3,7 +3,8 @@ import React, { useEffect } from 'react'; import { ManagerContext } from 'storybook/internal/manager-api'; import type { Meta, StoryObj } from '@storybook/react'; -import { within } from '@storybook/test'; + +import { within } from 'storybook/test'; import { LayoutProvider, useLayout } from '../../layout/LayoutProvider'; import { MobileAbout } from './MobileAbout'; diff --git a/code/core/src/manager/components/mobile/navigation/MobileNavigation.stories.tsx b/code/core/src/manager/components/mobile/navigation/MobileNavigation.stories.tsx index 3ee9be594fc..9a50930fa6a 100644 --- a/code/core/src/manager/components/mobile/navigation/MobileNavigation.stories.tsx +++ b/code/core/src/manager/components/mobile/navigation/MobileNavigation.stories.tsx @@ -3,9 +3,9 @@ import React from 'react'; import { ManagerContext } from 'storybook/internal/manager-api'; import type { Meta, StoryObj } from '@storybook/react'; -import { within } from '@storybook/test'; import { startCase } from 'es-toolkit'; +import { within } from 'storybook/test'; import { LayoutProvider, useLayout } from '../../layout/LayoutProvider'; import { MobileNavigation } from './MobileNavigation'; diff --git a/code/core/src/manager/components/notifications/NotificationItem.stories.tsx b/code/core/src/manager/components/notifications/NotificationItem.stories.tsx index 3af2381d945..453ca0393af 100644 --- a/code/core/src/manager/components/notifications/NotificationItem.stories.tsx +++ b/code/core/src/manager/components/notifications/NotificationItem.stories.tsx @@ -8,10 +8,11 @@ import { FaceHappyIcon, } from '@storybook/icons'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, fn, userEvent, waitFor, within } from '@storybook/test'; import { action } from '@storybook/addon-actions'; +import { expect, fn, userEvent, waitFor, within } from 'storybook/test'; + import NotificationItem from './NotificationItem'; const meta = { diff --git a/code/core/src/manager/components/sidebar/FileSearchList.stories.tsx b/code/core/src/manager/components/sidebar/FileSearchList.stories.tsx index 7388bf3cb4a..fd760a5f275 100644 --- a/code/core/src/manager/components/sidebar/FileSearchList.stories.tsx +++ b/code/core/src/manager/components/sidebar/FileSearchList.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { expect, findByText, fireEvent, fn } from '@storybook/test'; + +import { expect, findByText, fireEvent, fn } from 'storybook/test'; import { FileSearchList } from './FileSearchList'; diff --git a/code/core/src/manager/components/sidebar/FileSearchModal.stories.tsx b/code/core/src/manager/components/sidebar/FileSearchModal.stories.tsx index c9e1790ef11..52fcd0de34f 100644 --- a/code/core/src/manager/components/sidebar/FileSearchModal.stories.tsx +++ b/code/core/src/manager/components/sidebar/FileSearchModal.stories.tsx @@ -1,7 +1,8 @@ import React, { useState } from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, findByText, fireEvent, fn } from '@storybook/test'; + +import { expect, findByText, fireEvent, fn } from 'storybook/test'; import { WithResults } from './FileSearchList.stories'; import { FileSearchModal } from './FileSearchModal'; diff --git a/code/core/src/manager/components/sidebar/FilterToggle.stories.ts b/code/core/src/manager/components/sidebar/FilterToggle.stories.ts index 075b8c94dc9..f7528c87afe 100644 --- a/code/core/src/manager/components/sidebar/FilterToggle.stories.ts +++ b/code/core/src/manager/components/sidebar/FilterToggle.stories.ts @@ -1,4 +1,4 @@ -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import { FilterToggle } from './FilterToggle'; diff --git a/code/core/src/manager/components/sidebar/Heading.stories.tsx b/code/core/src/manager/components/sidebar/Heading.stories.tsx index 8e12d3eb777..603b0c0f05d 100644 --- a/code/core/src/manager/components/sidebar/Heading.stories.tsx +++ b/code/core/src/manager/components/sidebar/Heading.stories.tsx @@ -5,10 +5,11 @@ import { ThemeProvider, useTheme } from 'storybook/internal/theming'; import type { Theme } from 'storybook/internal/theming'; import type { Meta, StoryFn, StoryObj } from '@storybook/react'; -import { screen } from '@storybook/test'; import { action } from '@storybook/addon-actions'; +import { screen } from 'storybook/test'; + import { Heading } from './Heading'; type Story = StoryFn; diff --git a/code/core/src/manager/components/sidebar/Menu.stories.tsx b/code/core/src/manager/components/sidebar/Menu.stories.tsx index 858a04a2be9..6f085af4882 100644 --- a/code/core/src/manager/components/sidebar/Menu.stories.tsx +++ b/code/core/src/manager/components/sidebar/Menu.stories.tsx @@ -6,7 +6,8 @@ import { styled } from 'storybook/internal/theming'; import { LinkIcon } from '@storybook/icons'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, screen, userEvent, within } from '@storybook/test'; + +import { expect, screen, userEvent, within } from 'storybook/test'; import { useMenu } from '../../container/Menu'; import { LayoutProvider } from '../layout/LayoutProvider'; diff --git a/code/core/src/manager/components/sidebar/Refs.stories.tsx b/code/core/src/manager/components/sidebar/Refs.stories.tsx index c137c252e11..7dd746e4123 100644 --- a/code/core/src/manager/components/sidebar/Refs.stories.tsx +++ b/code/core/src/manager/components/sidebar/Refs.stories.tsx @@ -2,7 +2,7 @@ import React from 'react'; import { ManagerContext } from 'storybook/internal/manager-api'; -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import { standardData as standardHeaderData } from './Heading.stories'; import { IconSymbols } from './IconSymbols'; diff --git a/code/core/src/manager/components/sidebar/Sidebar.stories.tsx b/code/core/src/manager/components/sidebar/Sidebar.stories.tsx index 973419fccc7..f65bd2f1d78 100644 --- a/code/core/src/manager/components/sidebar/Sidebar.stories.tsx +++ b/code/core/src/manager/components/sidebar/Sidebar.stories.tsx @@ -5,7 +5,8 @@ import { ManagerContext } from 'storybook/internal/manager-api'; import type { API_StatusState, Addon_SidebarTopType } from 'storybook/internal/types'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, fn, userEvent, within } from '@storybook/test'; + +import { expect, fn, userEvent, within } from 'storybook/test'; import { LayoutProvider } from '../layout/LayoutProvider'; import { standardData as standardHeaderData } from './Heading.stories'; diff --git a/code/core/src/manager/components/sidebar/SidebarBottom.stories.tsx b/code/core/src/manager/components/sidebar/SidebarBottom.stories.tsx index 9d7fd7d8392..843652a7d7f 100644 --- a/code/core/src/manager/components/sidebar/SidebarBottom.stories.tsx +++ b/code/core/src/manager/components/sidebar/SidebarBottom.stories.tsx @@ -4,7 +4,8 @@ import { type API, ManagerContext } from 'storybook/internal/manager-api'; import { Addon_TypesEnum } from 'storybook/internal/types'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, fireEvent, fn, waitFor, within } from '@storybook/test'; + +import { expect, fireEvent, fn, waitFor, within } from 'storybook/test'; import { SidebarBottomBase } from './SidebarBottom'; diff --git a/code/core/src/manager/components/sidebar/TagsFilter.stories.tsx b/code/core/src/manager/components/sidebar/TagsFilter.stories.tsx index 89236acda68..96e5d6ab4c0 100644 --- a/code/core/src/manager/components/sidebar/TagsFilter.stories.tsx +++ b/code/core/src/manager/components/sidebar/TagsFilter.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { findByRole, fn } from '@storybook/test'; + +import { findByRole, fn } from 'storybook/test'; import { TagsFilter } from './TagsFilter'; diff --git a/code/core/src/manager/components/sidebar/TagsFilterPanel.stories.tsx b/code/core/src/manager/components/sidebar/TagsFilterPanel.stories.tsx index 0602d0ed7a4..74f47769aef 100644 --- a/code/core/src/manager/components/sidebar/TagsFilterPanel.stories.tsx +++ b/code/core/src/manager/components/sidebar/TagsFilterPanel.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { TagsFilterPanel } from './TagsFilterPanel'; diff --git a/code/core/src/manager/components/sidebar/TestingModule.stories.tsx b/code/core/src/manager/components/sidebar/TestingModule.stories.tsx index b043c006b4c..e7af5259a2e 100644 --- a/code/core/src/manager/components/sidebar/TestingModule.stories.tsx +++ b/code/core/src/manager/components/sidebar/TestingModule.stories.tsx @@ -7,7 +7,8 @@ import { styled } from 'storybook/internal/theming'; import { Addon_TypesEnum } from 'storybook/internal/types'; import type { Meta, StoryObj } from '@storybook/react'; -import { fireEvent, fn } from '@storybook/test'; + +import { fireEvent, fn } from 'storybook/test'; import { TestingModule } from './TestingModule'; diff --git a/code/core/src/manager/components/sidebar/Tree.stories.tsx b/code/core/src/manager/components/sidebar/Tree.stories.tsx index fdc231ba94f..73fc41c5616 100644 --- a/code/core/src/manager/components/sidebar/Tree.stories.tsx +++ b/code/core/src/manager/components/sidebar/Tree.stories.tsx @@ -8,10 +8,11 @@ import { } from 'storybook/internal/manager-api'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, fn, userEvent, within } from '@storybook/test'; import { action } from '@storybook/addon-actions'; +import { expect, fn, userEvent, within } from 'storybook/test'; + import { DEFAULT_REF_ID } from './Sidebar'; import { Tree } from './Tree'; import { index } from './mockdata.large'; diff --git a/code/core/src/manager/components/upgrade/UpgradeBlock.stories.tsx b/code/core/src/manager/components/upgrade/UpgradeBlock.stories.tsx index e882a41bf18..e9d06093621 100644 --- a/code/core/src/manager/components/upgrade/UpgradeBlock.stories.tsx +++ b/code/core/src/manager/components/upgrade/UpgradeBlock.stories.tsx @@ -3,7 +3,8 @@ import React from 'react'; import { ManagerContext } from 'storybook/internal/manager-api'; import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { UpgradeBlock } from './UpgradeBlock'; diff --git a/code/core/src/manager/settings/about.stories.tsx b/code/core/src/manager/settings/about.stories.tsx index d63d246d447..670d4c3cbfc 100644 --- a/code/core/src/manager/settings/about.stories.tsx +++ b/code/core/src/manager/settings/about.stories.tsx @@ -1,7 +1,8 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import UpgradeBlockStoriesMeta from '../components/upgrade/UpgradeBlock.stories'; import { AboutScreen } from './About'; diff --git a/code/core/src/preview-errors.ts b/code/core/src/preview-errors.ts index eb083277daa..bed6db57243 100644 --- a/code/core/src/preview-errors.ts +++ b/code/core/src/preview-errors.ts @@ -60,7 +60,7 @@ export class ImplicitActionsDuringRendering extends StorybookError { We detected that you use an implicit action arg while ${data.phase} of your story. ${data.deprecated ? `\nThis is deprecated and won't work in Storybook 8 anymore.\n` : ``} Please provide an explicit spy to your args like this: - import { fn } from '@storybook/test'; + import { fn } from 'storybook/test'; ... args: { ${data.name}: fn() diff --git a/code/core/src/shared/universal-store/mock.ts b/code/core/src/shared/universal-store/mock.ts index a5695f48464..fc7214300ce 100644 --- a/code/core/src/shared/universal-store/mock.ts +++ b/code/core/src/shared/universal-store/mock.ts @@ -21,7 +21,7 @@ import type { StoreOptions } from './types'; * @example * * ```ts - * import * as testUtils from '@storybook/test'; // in stories + * import * as testUtils from 'storybook/test'; // in stories * import { vi as testUtils } from 'vitest'; // ... or in Vitest tests * * const initialState = { ... }; diff --git a/code/core/src/test/index.test.ts b/code/core/src/test/index.test.ts index e87c485c991..fb9fe2cd5ae 100644 --- a/code/core/src/test/index.test.ts +++ b/code/core/src/test/index.test.ts @@ -1,10 +1,10 @@ // @vitest-environment happy-dom import { describe, it, test } from 'vitest'; -import { expect, fn, isMockFunction, traverseArgs } from '@storybook/test'; - import { action } from '@storybook/addon-actions'; +import { expect, fn, isMockFunction, traverseArgs } from 'storybook/test'; + it('storybook expect and fn can be used in vitest test', () => { const spy = fn(); spy(1); diff --git a/code/core/template/stories/argMapping.stories.ts b/code/core/template/stories/argMapping.stories.ts index f2813a95d26..004ffd581e8 100644 --- a/code/core/template/stories/argMapping.stories.ts +++ b/code/core/template/stories/argMapping.stories.ts @@ -1,7 +1,7 @@ import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; const arrows = { ArrowUp: { name: 'ArrowUp' }, diff --git a/code/core/template/stories/argTypes.stories.ts b/code/core/template/stories/argTypes.stories.ts index d64316c63b8..8e2731f8f2e 100644 --- a/code/core/template/stories/argTypes.stories.ts +++ b/code/core/template/stories/argTypes.stories.ts @@ -1,7 +1,7 @@ import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/args.stories.ts b/code/core/template/stories/args.stories.ts index 43eed8f5070..12ca32b9fe4 100644 --- a/code/core/template/stories/args.stories.ts +++ b/code/core/template/stories/args.stories.ts @@ -6,7 +6,7 @@ import { import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; function pick(obj, keys) { const result = {}; diff --git a/code/core/template/stories/autotitle.stories.ts b/code/core/template/stories/autotitle.stories.ts index 9399cf24121..6cf4173e43c 100644 --- a/code/core/template/stories/autotitle.stories.ts +++ b/code/core/template/stories/autotitle.stories.ts @@ -1,7 +1,7 @@ import type { PlayFunctionContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect } from '@storybook/test'; +import { expect } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/before-each.stories.ts b/code/core/template/stories/before-each.stories.ts index 0d9a88cafa3..5d23e6c8b12 100644 --- a/code/core/template/stories/before-each.stories.ts +++ b/code/core/template/stories/before-each.stories.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention,storybook/prefer-pascal-case */ -import { expect } from '@storybook/test'; +import { expect } from 'storybook/test'; const meta = { component: globalThis.Components.Button, diff --git a/code/core/template/stories/component-play.stories.ts b/code/core/template/stories/component-play.stories.ts index db93783ed16..45ec63a8f53 100644 --- a/code/core/template/stories/component-play.stories.ts +++ b/code/core/template/stories/component-play.stories.ts @@ -1,7 +1,7 @@ import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/decorators.stories.ts b/code/core/template/stories/decorators.stories.ts index d0822c0ab8c..f3602596898 100644 --- a/code/core/template/stories/decorators.stories.ts +++ b/code/core/template/stories/decorators.stories.ts @@ -12,7 +12,7 @@ import type { } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/destructuring-not-transpiled.stories.ts b/code/core/template/stories/destructuring-not-transpiled.stories.ts index b1f2c98e220..9e0490cede3 100644 --- a/code/core/template/stories/destructuring-not-transpiled.stories.ts +++ b/code/core/template/stories/destructuring-not-transpiled.stories.ts @@ -1,5 +1,5 @@ import { global as globalThis } from '@storybook/global'; -import { expect } from '@storybook/test'; +import { expect } from 'storybook/test'; export default { component: globalThis.Components.Button, diff --git a/code/core/template/stories/globals.stories.ts b/code/core/template/stories/globals.stories.ts index cbede539ce7..60378181448 100644 --- a/code/core/template/stories/globals.stories.ts +++ b/code/core/template/stories/globals.stories.ts @@ -1,7 +1,7 @@ import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/hooks.stories.ts b/code/core/template/stories/hooks.stories.ts index b2d2cc01e73..6a2d22ffe88 100644 --- a/code/core/template/stories/hooks.stories.ts +++ b/code/core/template/stories/hooks.stories.ts @@ -2,7 +2,7 @@ import { useEffect, useState } from 'storybook/internal/preview-api'; import type { PartialStoryFn, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { userEvent, within } from '@storybook/test'; +import { userEvent, within } from 'storybook/test'; export default { component: globalThis.Components.Button, diff --git a/code/core/template/stories/indexer.stories.ts b/code/core/template/stories/indexer.stories.ts index 684b195e5bf..d432751f215 100644 --- a/code/core/template/stories/indexer.stories.ts +++ b/code/core/template/stories/indexer.stories.ts @@ -1,7 +1,7 @@ import type { PlayFunctionContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect } from '@storybook/test'; +import { expect } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/loader-enhancements.stories.ts b/code/core/template/stories/loader-enhancements.stories.ts index fdd1a7c4e64..07ac2d783b6 100644 --- a/code/core/template/stories/loader-enhancements.stories.ts +++ b/code/core/template/stories/loader-enhancements.stories.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention,storybook/prefer-pascal-case */ -import { expect, userEvent as globalUserEvent, within } from '@storybook/test'; +import { expect, userEvent as globalUserEvent, within } from 'storybook/test'; const meta = { component: globalThis.Components.Button, diff --git a/code/core/template/stories/loaders.stories.ts b/code/core/template/stories/loaders.stories.ts index b9a5d31eaf1..3c40352cd9c 100644 --- a/code/core/template/stories/loaders.stories.ts +++ b/code/core/template/stories/loaders.stories.ts @@ -1,7 +1,7 @@ import type { PartialStoryFn, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/module-mocking.stories.ts b/code/core/template/stories/module-mocking.stories.ts index f773f675ff5..317d39597ba 100644 --- a/code/core/template/stories/module-mocking.stories.ts +++ b/code/core/template/stories/module-mocking.stories.ts @@ -1,5 +1,5 @@ import { global as globalThis } from '@storybook/global'; -import { expect, fn, isMockFunction, mocked } from '@storybook/test'; +import { expect, fn, isMockFunction, mocked } from 'storybook/test'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore This alias is set in the sandbox. Using ts-ignore instead of ts-expect-error to avoid build errors in the sandbox. diff --git a/code/core/template/stories/mount-in-play.stories.ts b/code/core/template/stories/mount-in-play.stories.ts index 22c92497783..795c0a2fd5a 100644 --- a/code/core/template/stories/mount-in-play.stories.ts +++ b/code/core/template/stories/mount-in-play.stories.ts @@ -1,4 +1,4 @@ -import { expect, fn } from '@storybook/test'; +import { expect, fn } from 'storybook/test'; const meta = { component: globalThis.Components.Button }; diff --git a/code/core/template/stories/names.stories.ts b/code/core/template/stories/names.stories.ts index 9ad9320b4e5..e3789ce93ec 100644 --- a/code/core/template/stories/names.stories.ts +++ b/code/core/template/stories/names.stories.ts @@ -1,7 +1,7 @@ import type { PlayFunctionContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect } from '@storybook/test'; +import { expect } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/parameters.stories.ts b/code/core/template/stories/parameters.stories.ts index 5d702019719..00487ced490 100644 --- a/code/core/template/stories/parameters.stories.ts +++ b/code/core/template/stories/parameters.stories.ts @@ -1,7 +1,7 @@ import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/rendering.stories.ts b/code/core/template/stories/rendering.stories.ts index 31cb903d19b..45cb1bd57e2 100644 --- a/code/core/template/stories/rendering.stories.ts +++ b/code/core/template/stories/rendering.stories.ts @@ -7,7 +7,7 @@ import { import type { PlayFunctionContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, waitFor, within } from '@storybook/test'; +import { expect, waitFor, within } from 'storybook/test'; export default { component: globalThis.Components.Button, diff --git a/code/core/template/stories/shortcuts.stories.ts b/code/core/template/stories/shortcuts.stories.ts index 998b417d3de..a9c334ca481 100644 --- a/code/core/template/stories/shortcuts.stories.ts +++ b/code/core/template/stories/shortcuts.stories.ts @@ -2,7 +2,7 @@ import { PREVIEW_KEYDOWN } from 'storybook/internal/core-events'; import type { PlayFunctionContext } from 'storybook/internal/csf'; import { global as globalThis } from '@storybook/global'; -import { expect, fn, userEvent, within } from '@storybook/test'; +import { expect, fn, userEvent, within } from 'storybook/test'; export default { component: globalThis.Components.Form, diff --git a/code/core/template/stories/tags-add.stories.ts b/code/core/template/stories/tags-add.stories.ts index a86addb4aea..edb09cd39f3 100644 --- a/code/core/template/stories/tags-add.stories.ts +++ b/code/core/template/stories/tags-add.stories.ts @@ -1,7 +1,7 @@ import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/tags-config.stories.ts b/code/core/template/stories/tags-config.stories.ts index 03c835832e5..df211639d37 100644 --- a/code/core/template/stories/tags-config.stories.ts +++ b/code/core/template/stories/tags-config.stories.ts @@ -1,7 +1,7 @@ import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/tags-remove.stories.ts b/code/core/template/stories/tags-remove.stories.ts index 27c313381a7..9d948f3d526 100644 --- a/code/core/template/stories/tags-remove.stories.ts +++ b/code/core/template/stories/tags-remove.stories.ts @@ -1,7 +1,7 @@ import type { PartialStoryFn, PlayFunctionContext, StoryContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect, within } from '@storybook/test'; +import { expect, within } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/title.stories.ts b/code/core/template/stories/title.stories.ts index 0c0246a096f..6e2c74c50ab 100644 --- a/code/core/template/stories/title.stories.ts +++ b/code/core/template/stories/title.stories.ts @@ -1,7 +1,7 @@ import type { PlayFunctionContext } from 'storybook/internal/types'; import { global as globalThis } from '@storybook/global'; -import { expect } from '@storybook/test'; +import { expect } from 'storybook/test'; export default { component: globalThis.Components.Pre, diff --git a/code/core/template/stories/utils.mock.ts b/code/core/template/stories/utils.mock.ts index 93a72d03a0e..430f08797ae 100644 --- a/code/core/template/stories/utils.mock.ts +++ b/code/core/template/stories/utils.mock.ts @@ -1,4 +1,4 @@ -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import * as utils from './utils.ts'; diff --git a/code/frameworks/angular/template/cli/button.stories.ts b/code/frameworks/angular/template/cli/button.stories.ts index dedeca1f2e9..5c12e314188 100644 --- a/code/frameworks/angular/template/cli/button.stories.ts +++ b/code/frameworks/angular/template/cli/button.stories.ts @@ -1,5 +1,5 @@ import type { Meta, StoryObj } from '@storybook/angular'; -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import { ButtonComponent } from './button.component'; diff --git a/code/frameworks/angular/template/cli/header.stories.ts b/code/frameworks/angular/template/cli/header.stories.ts index ea9b0894e4b..8a9f73b151c 100644 --- a/code/frameworks/angular/template/cli/header.stories.ts +++ b/code/frameworks/angular/template/cli/header.stories.ts @@ -1,5 +1,5 @@ import type { Meta, StoryObj } from '@storybook/angular'; -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import { HeaderComponent } from './header.component'; diff --git a/code/frameworks/angular/template/cli/page.stories.ts b/code/frameworks/angular/template/cli/page.stories.ts index 8237ee228b3..47c99b233f7 100644 --- a/code/frameworks/angular/template/cli/page.stories.ts +++ b/code/frameworks/angular/template/cli/page.stories.ts @@ -1,5 +1,5 @@ import type { Meta, StoryObj } from '@storybook/angular'; -import { expect, userEvent, within } from '@storybook/test'; +import { expect, userEvent, within } from 'storybook/test'; import { PageComponent } from './page.component'; diff --git a/code/frameworks/angular/template/stories_angular-cli-default-ts/signal/button.stories.ts b/code/frameworks/angular/template/stories_angular-cli-default-ts/signal/button.stories.ts index db1fa2125d5..6849fc9bb42 100644 --- a/code/frameworks/angular/template/stories_angular-cli-default-ts/signal/button.stories.ts +++ b/code/frameworks/angular/template/stories_angular-cli-default-ts/signal/button.stories.ts @@ -1,5 +1,5 @@ import { Meta, StoryObj } from '@storybook/angular'; -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import SignalButtonComponent from './button.component'; diff --git a/code/frameworks/angular/template/stories_angular-cli-prerelease/signal/button.stories.ts b/code/frameworks/angular/template/stories_angular-cli-prerelease/signal/button.stories.ts index db1fa2125d5..6849fc9bb42 100644 --- a/code/frameworks/angular/template/stories_angular-cli-prerelease/signal/button.stories.ts +++ b/code/frameworks/angular/template/stories_angular-cli-prerelease/signal/button.stories.ts @@ -1,5 +1,5 @@ import { Meta, StoryObj } from '@storybook/angular'; -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import SignalButtonComponent from './button.component'; diff --git a/code/frameworks/ember/template/cli/Button.stories.js b/code/frameworks/ember/template/cli/Button.stories.js index 35ba57166a7..93511eade46 100644 --- a/code/frameworks/ember/template/cli/Button.stories.js +++ b/code/frameworks/ember/template/cli/Button.stories.js @@ -1,9 +1,8 @@ -import { fn } from '@storybook/test'; - import { action } from '@storybook/addon-actions'; import { linkTo } from '@storybook/addon-links'; import { hbs } from 'ember-cli-htmlbars'; +import { fn } from 'storybook/test'; // More on how to set up stories at: https://storybook.js.org/docs/writing-stories export default { diff --git a/code/frameworks/experimental-nextjs-vite/src/export-mocks/cache/index.ts b/code/frameworks/experimental-nextjs-vite/src/export-mocks/cache/index.ts index 35b74b8cb02..d81ed0affc7 100644 --- a/code/frameworks/experimental-nextjs-vite/src/export-mocks/cache/index.ts +++ b/code/frameworks/experimental-nextjs-vite/src/export-mocks/cache/index.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/naming-convention */ -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; // biome-ignore lint/suspicious/noExplicitAny: type Callback = (...args: any[]) => Promise; diff --git a/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/cookies.ts b/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/cookies.ts index b1eb6a692ef..4697a1afb97 100644 --- a/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/cookies.ts +++ b/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/cookies.ts @@ -1,13 +1,12 @@ // We need this import to be a singleton, and because it's used in multiple entrypoints // both in ESM and CJS, importing it via the package name instead of having a local import // is the only way to achieve it actually being a singleton -import { fn } from '@storybook/test'; - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore we must ignore types here as during compilation they are not generated yet import { headers } from '@storybook/experimental-nextjs-vite/headers.mock'; import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies'; +import { fn } from 'storybook/test'; class RequestCookiesMock extends RequestCookies { get = fn(super.get.bind(this)).mockName('next/headers::cookies().get'); diff --git a/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/headers.ts b/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/headers.ts index 1aceec57089..1d65c9285d9 100644 --- a/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/headers.ts +++ b/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/headers.ts @@ -1,6 +1,5 @@ -import { fn } from '@storybook/test'; - import { HeadersAdapter } from 'next/dist/server/web/spec-extension/adapters/headers'; +import { fn } from 'storybook/test'; class HeadersAdapterMock extends HeadersAdapter { constructor() { diff --git a/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/index.ts b/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/index.ts index 1c903963ba2..f1e27b49c64 100644 --- a/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/index.ts +++ b/code/frameworks/experimental-nextjs-vite/src/export-mocks/headers/index.ts @@ -1,7 +1,6 @@ -import { fn } from '@storybook/test'; - import { draftMode as originalDraftMode } from 'next/dist/server/request/draft-mode'; import * as headers from 'next/dist/server/request/headers'; +import { fn } from 'storybook/test'; // re-exports of the actual module export * from 'next/dist/server/request/headers'; diff --git a/code/frameworks/experimental-nextjs-vite/src/export-mocks/navigation/index.ts b/code/frameworks/experimental-nextjs-vite/src/export-mocks/navigation/index.ts index 8cec0b3266f..c2c63c3c78d 100644 --- a/code/frameworks/experimental-nextjs-vite/src/export-mocks/navigation/index.ts +++ b/code/frameworks/experimental-nextjs-vite/src/export-mocks/navigation/index.ts @@ -1,11 +1,10 @@ import { NextjsRouterMocksNotAvailable } from 'storybook/internal/preview-errors'; -import type { Mock } from '@storybook/test'; -import { fn } from '@storybook/test'; - import * as actual from 'next/dist/client/components/navigation'; import { getRedirectError } from 'next/dist/client/components/redirect'; import { RedirectStatusCode } from 'next/dist/client/components/redirect-status-code'; +import type { Mock } from 'storybook/test'; +import { fn } from 'storybook/test'; let navigationAPI: { push: Mock; diff --git a/code/frameworks/experimental-nextjs-vite/src/export-mocks/router/index.ts b/code/frameworks/experimental-nextjs-vite/src/export-mocks/router/index.ts index c6e93e804f0..26ee30342c7 100644 --- a/code/frameworks/experimental-nextjs-vite/src/export-mocks/router/index.ts +++ b/code/frameworks/experimental-nextjs-vite/src/export-mocks/router/index.ts @@ -1,10 +1,9 @@ import { NextjsRouterMocksNotAvailable } from 'storybook/internal/preview-errors'; -import type { Mock } from '@storybook/test'; -import { fn } from '@storybook/test'; - import singletonRouter, * as originalRouter from 'next/dist/client/router'; import type { NextRouter, SingletonRouter } from 'next/router'; +import type { Mock } from 'storybook/test'; +import { fn } from 'storybook/test'; const defaultRouterState = { route: '/', diff --git a/code/frameworks/experimental-nextjs-vite/template/cli/js/Button.stories.js b/code/frameworks/experimental-nextjs-vite/template/cli/js/Button.stories.js index 045d9c477ab..1b56021e71d 100644 --- a/code/frameworks/experimental-nextjs-vite/template/cli/js/Button.stories.js +++ b/code/frameworks/experimental-nextjs-vite/template/cli/js/Button.stories.js @@ -1,4 +1,4 @@ -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import { Button } from './Button'; diff --git a/code/frameworks/experimental-nextjs-vite/template/cli/js/Header.stories.js b/code/frameworks/experimental-nextjs-vite/template/cli/js/Header.stories.js index 699abab0794..9fe689e0ac8 100644 --- a/code/frameworks/experimental-nextjs-vite/template/cli/js/Header.stories.js +++ b/code/frameworks/experimental-nextjs-vite/template/cli/js/Header.stories.js @@ -1,4 +1,4 @@ -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import { Header } from './Header'; diff --git a/code/frameworks/experimental-nextjs-vite/template/cli/js/Page.stories.js b/code/frameworks/experimental-nextjs-vite/template/cli/js/Page.stories.js index 7b9906a7351..1ffea36cf37 100644 --- a/code/frameworks/experimental-nextjs-vite/template/cli/js/Page.stories.js +++ b/code/frameworks/experimental-nextjs-vite/template/cli/js/Page.stories.js @@ -1,4 +1,4 @@ -import { expect, userEvent, within } from '@storybook/test'; +import { expect, userEvent, within } from 'storybook/test'; import { Page } from './Page'; diff --git a/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Button.stories.ts b/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Button.stories.ts index 2a05e01b06f..535e1b3fd96 100644 --- a/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Button.stories.ts +++ b/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Button.stories.ts @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { Button } from './Button'; diff --git a/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Header.stories.ts b/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Header.stories.ts index 80c71d0f520..b233bcb4f4d 100644 --- a/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Header.stories.ts +++ b/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Header.stories.ts @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { Header } from './Header'; diff --git a/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Page.stories.ts b/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Page.stories.ts index 5d2c688a978..6c39800e3e5 100644 --- a/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Page.stories.ts +++ b/code/frameworks/experimental-nextjs-vite/template/cli/ts-4-9/Page.stories.ts @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; + +import { expect, userEvent, within } from 'storybook/test'; import { Page } from './Page'; diff --git a/code/frameworks/experimental-nextjs-vite/template/stories/Head.stories.tsx b/code/frameworks/experimental-nextjs-vite/template/stories/Head.stories.tsx index 0d344078868..e31bce71f13 100644 --- a/code/frameworks/experimental-nextjs-vite/template/stories/Head.stories.tsx +++ b/code/frameworks/experimental-nextjs-vite/template/stories/Head.stories.tsx @@ -2,9 +2,9 @@ import React from 'react'; import type { Meta } from '@storybook/react'; import type { StoryObj } from '@storybook/react'; -import { expect, waitFor } from '@storybook/test'; import Head from 'next/head'; +import { expect, waitFor } from 'storybook/test'; function Component() { return ( diff --git a/code/frameworks/experimental-nextjs-vite/template/stories/Navigation.stories.tsx b/code/frameworks/experimental-nextjs-vite/template/stories/Navigation.stories.tsx index 4b9b49904de..a71e3a982ce 100644 --- a/code/frameworks/experimental-nextjs-vite/template/stories/Navigation.stories.tsx +++ b/code/frameworks/experimental-nextjs-vite/template/stories/Navigation.stories.tsx @@ -1,7 +1,6 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; import { getRouter } from '@storybook/experimental-nextjs-vite/navigation.mock'; @@ -13,6 +12,7 @@ import { useSelectedLayoutSegment, useSelectedLayoutSegments, } from 'next/navigation'; +import { expect, userEvent, within } from 'storybook/test'; function Component() { const router = useRouter(); diff --git a/code/frameworks/experimental-nextjs-vite/template/stories/NextHeader.stories.tsx b/code/frameworks/experimental-nextjs-vite/template/stories/NextHeader.stories.tsx index 1d31006f63e..60f1d1213fb 100644 --- a/code/frameworks/experimental-nextjs-vite/template/stories/NextHeader.stories.tsx +++ b/code/frameworks/experimental-nextjs-vite/template/stories/NextHeader.stories.tsx @@ -1,9 +1,10 @@ import type { Meta } from '@storybook/react'; import type { StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; import { cookies, headers } from '@storybook/experimental-nextjs-vite/headers.mock'; +import { expect, userEvent, within } from 'storybook/test'; + import NextHeader from './NextHeader'; export default { diff --git a/code/frameworks/experimental-nextjs-vite/template/stories/Redirect.stories.tsx b/code/frameworks/experimental-nextjs-vite/template/stories/Redirect.stories.tsx index 47fd4c5228d..d383105c819 100644 --- a/code/frameworks/experimental-nextjs-vite/template/stories/Redirect.stories.tsx +++ b/code/frameworks/experimental-nextjs-vite/template/stories/Redirect.stories.tsx @@ -1,9 +1,9 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { userEvent, within } from '@storybook/test'; import { redirect } from 'next/navigation'; +import { userEvent, within } from 'storybook/test'; let state = 'Bug! Not invalidated'; diff --git a/code/frameworks/experimental-nextjs-vite/template/stories/Router.stories.tsx b/code/frameworks/experimental-nextjs-vite/template/stories/Router.stories.tsx index 7b1d5b0ec0c..0be3864fd22 100644 --- a/code/frameworks/experimental-nextjs-vite/template/stories/Router.stories.tsx +++ b/code/frameworks/experimental-nextjs-vite/template/stories/Router.stories.tsx @@ -1,11 +1,11 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; import { getRouter } from '@storybook/experimental-nextjs-vite/router.mock'; import Router, { useRouter } from 'next/router'; +import { expect, userEvent, within } from 'storybook/test'; function Component() { const router = useRouter(); diff --git a/code/frameworks/experimental-nextjs-vite/template/stories/ServerActions.stories.tsx b/code/frameworks/experimental-nextjs-vite/template/stories/ServerActions.stories.tsx index 0844293c34f..ce57c4cdbbc 100644 --- a/code/frameworks/experimental-nextjs-vite/template/stories/ServerActions.stories.tsx +++ b/code/frameworks/experimental-nextjs-vite/template/stories/ServerActions.stories.tsx @@ -1,12 +1,13 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, waitFor, within } from '@storybook/test'; import { revalidatePath } from '@storybook/experimental-nextjs-vite/cache.mock'; import { cookies } from '@storybook/experimental-nextjs-vite/headers.mock'; import { getRouter, redirect } from '@storybook/experimental-nextjs-vite/navigation.mock'; +import { expect, userEvent, waitFor, within } from 'storybook/test'; + import { accessRoute, login, logout } from './ServerActions'; function Component() { diff --git a/code/frameworks/nextjs/src/export-mocks/cache/index.ts b/code/frameworks/nextjs/src/export-mocks/cache/index.ts index 0344304bc79..16ecd0b42e4 100644 --- a/code/frameworks/nextjs/src/export-mocks/cache/index.ts +++ b/code/frameworks/nextjs/src/export-mocks/cache/index.ts @@ -1,7 +1,6 @@ -import { fn } from '@storybook/test'; - import { unstable_cache } from 'next/dist/server/web/spec-extension/unstable-cache'; import { unstable_noStore } from 'next/dist/server/web/spec-extension/unstable-no-store'; +import { fn } from 'storybook/test'; // mock utilities/overrides (as of Next v14.2.0) const revalidatePath = fn().mockName('next/cache::revalidatePath'); diff --git a/code/frameworks/nextjs/src/export-mocks/headers/cookies.ts b/code/frameworks/nextjs/src/export-mocks/headers/cookies.ts index 02e335834b8..b8125b5fef1 100644 --- a/code/frameworks/nextjs/src/export-mocks/headers/cookies.ts +++ b/code/frameworks/nextjs/src/export-mocks/headers/cookies.ts @@ -4,9 +4,9 @@ // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore we must ignore types here as during compilation they are not generated yet import { headers } from '@storybook/nextjs/headers.mock'; -import { fn } from '@storybook/test'; import { RequestCookies } from 'next/dist/compiled/@edge-runtime/cookies'; +import { fn } from 'storybook/test'; class RequestCookiesMock extends RequestCookies { get = fn(super.get.bind(this)).mockName('next/headers::cookies().get'); diff --git a/code/frameworks/nextjs/src/export-mocks/headers/headers.ts b/code/frameworks/nextjs/src/export-mocks/headers/headers.ts index 1aceec57089..1d65c9285d9 100644 --- a/code/frameworks/nextjs/src/export-mocks/headers/headers.ts +++ b/code/frameworks/nextjs/src/export-mocks/headers/headers.ts @@ -1,6 +1,5 @@ -import { fn } from '@storybook/test'; - import { HeadersAdapter } from 'next/dist/server/web/spec-extension/adapters/headers'; +import { fn } from 'storybook/test'; class HeadersAdapterMock extends HeadersAdapter { constructor() { diff --git a/code/frameworks/nextjs/src/export-mocks/headers/index.ts b/code/frameworks/nextjs/src/export-mocks/headers/index.ts index 1c903963ba2..f1e27b49c64 100644 --- a/code/frameworks/nextjs/src/export-mocks/headers/index.ts +++ b/code/frameworks/nextjs/src/export-mocks/headers/index.ts @@ -1,7 +1,6 @@ -import { fn } from '@storybook/test'; - import { draftMode as originalDraftMode } from 'next/dist/server/request/draft-mode'; import * as headers from 'next/dist/server/request/headers'; +import { fn } from 'storybook/test'; // re-exports of the actual module export * from 'next/dist/server/request/headers'; diff --git a/code/frameworks/nextjs/src/export-mocks/navigation/index.ts b/code/frameworks/nextjs/src/export-mocks/navigation/index.ts index 8cec0b3266f..c2c63c3c78d 100644 --- a/code/frameworks/nextjs/src/export-mocks/navigation/index.ts +++ b/code/frameworks/nextjs/src/export-mocks/navigation/index.ts @@ -1,11 +1,10 @@ import { NextjsRouterMocksNotAvailable } from 'storybook/internal/preview-errors'; -import type { Mock } from '@storybook/test'; -import { fn } from '@storybook/test'; - import * as actual from 'next/dist/client/components/navigation'; import { getRedirectError } from 'next/dist/client/components/redirect'; import { RedirectStatusCode } from 'next/dist/client/components/redirect-status-code'; +import type { Mock } from 'storybook/test'; +import { fn } from 'storybook/test'; let navigationAPI: { push: Mock; diff --git a/code/frameworks/nextjs/src/export-mocks/router/index.ts b/code/frameworks/nextjs/src/export-mocks/router/index.ts index c6e93e804f0..26ee30342c7 100644 --- a/code/frameworks/nextjs/src/export-mocks/router/index.ts +++ b/code/frameworks/nextjs/src/export-mocks/router/index.ts @@ -1,10 +1,9 @@ import { NextjsRouterMocksNotAvailable } from 'storybook/internal/preview-errors'; -import type { Mock } from '@storybook/test'; -import { fn } from '@storybook/test'; - import singletonRouter, * as originalRouter from 'next/dist/client/router'; import type { NextRouter, SingletonRouter } from 'next/router'; +import type { Mock } from 'storybook/test'; +import { fn } from 'storybook/test'; const defaultRouterState = { route: '/', diff --git a/code/frameworks/nextjs/template/cli/js/Button.stories.js b/code/frameworks/nextjs/template/cli/js/Button.stories.js index 045d9c477ab..1b56021e71d 100644 --- a/code/frameworks/nextjs/template/cli/js/Button.stories.js +++ b/code/frameworks/nextjs/template/cli/js/Button.stories.js @@ -1,4 +1,4 @@ -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import { Button } from './Button'; diff --git a/code/frameworks/nextjs/template/cli/js/Header.stories.js b/code/frameworks/nextjs/template/cli/js/Header.stories.js index 699abab0794..9fe689e0ac8 100644 --- a/code/frameworks/nextjs/template/cli/js/Header.stories.js +++ b/code/frameworks/nextjs/template/cli/js/Header.stories.js @@ -1,4 +1,4 @@ -import { fn } from '@storybook/test'; +import { fn } from 'storybook/test'; import { Header } from './Header'; diff --git a/code/frameworks/nextjs/template/cli/js/Page.stories.js b/code/frameworks/nextjs/template/cli/js/Page.stories.js index 7b9906a7351..1ffea36cf37 100644 --- a/code/frameworks/nextjs/template/cli/js/Page.stories.js +++ b/code/frameworks/nextjs/template/cli/js/Page.stories.js @@ -1,4 +1,4 @@ -import { expect, userEvent, within } from '@storybook/test'; +import { expect, userEvent, within } from 'storybook/test'; import { Page } from './Page'; diff --git a/code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts b/code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts index 2a05e01b06f..535e1b3fd96 100644 --- a/code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts +++ b/code/frameworks/nextjs/template/cli/ts-4-9/Button.stories.ts @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { Button } from './Button'; diff --git a/code/frameworks/nextjs/template/cli/ts-4-9/Header.stories.ts b/code/frameworks/nextjs/template/cli/ts-4-9/Header.stories.ts index 80c71d0f520..b233bcb4f4d 100644 --- a/code/frameworks/nextjs/template/cli/ts-4-9/Header.stories.ts +++ b/code/frameworks/nextjs/template/cli/ts-4-9/Header.stories.ts @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { Header } from './Header'; diff --git a/code/frameworks/nextjs/template/cli/ts-4-9/Page.stories.ts b/code/frameworks/nextjs/template/cli/ts-4-9/Page.stories.ts index 5d2c688a978..6c39800e3e5 100644 --- a/code/frameworks/nextjs/template/cli/ts-4-9/Page.stories.ts +++ b/code/frameworks/nextjs/template/cli/ts-4-9/Page.stories.ts @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; + +import { expect, userEvent, within } from 'storybook/test'; import { Page } from './Page'; diff --git a/code/frameworks/nextjs/template/stories/Head.stories.tsx b/code/frameworks/nextjs/template/stories/Head.stories.tsx index 540d0e04dc3..14269395a34 100644 --- a/code/frameworks/nextjs/template/stories/Head.stories.tsx +++ b/code/frameworks/nextjs/template/stories/Head.stories.tsx @@ -1,9 +1,9 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, waitFor } from '@storybook/test'; import Head from 'next/head'; +import { expect, waitFor } from 'storybook/test'; function Component() { return ( diff --git a/code/frameworks/nextjs/template/stories/Navigation.stories.tsx b/code/frameworks/nextjs/template/stories/Navigation.stories.tsx index 5c4872d1ac3..f9e33684658 100644 --- a/code/frameworks/nextjs/template/stories/Navigation.stories.tsx +++ b/code/frameworks/nextjs/template/stories/Navigation.stories.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { getRouter } from '@storybook/nextjs/navigation.mock'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; import { useParams, @@ -12,6 +11,7 @@ import { useSelectedLayoutSegment, useSelectedLayoutSegments, } from 'next/navigation'; +import { expect, userEvent, within } from 'storybook/test'; function Component() { const router = useRouter(); diff --git a/code/frameworks/nextjs/template/stories/Router.stories.tsx b/code/frameworks/nextjs/template/stories/Router.stories.tsx index d6586364fd0..b7e31de4159 100644 --- a/code/frameworks/nextjs/template/stories/Router.stories.tsx +++ b/code/frameworks/nextjs/template/stories/Router.stories.tsx @@ -2,9 +2,9 @@ import React from 'react'; import { getRouter } from '@storybook/nextjs/router.mock'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; import Router, { useRouter } from 'next/router'; +import { expect, userEvent, within } from 'storybook/test'; function Component() { const router = useRouter(); diff --git a/code/frameworks/nextjs/template/stories_nextjs-default-ts/NextHeader.stories.tsx b/code/frameworks/nextjs/template/stories_nextjs-default-ts/NextHeader.stories.tsx index f5e83ef867f..040154706aa 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-default-ts/NextHeader.stories.tsx +++ b/code/frameworks/nextjs/template/stories_nextjs-default-ts/NextHeader.stories.tsx @@ -1,6 +1,7 @@ import { cookies, headers } from '@storybook/nextjs/headers.mock'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; + +import { expect, userEvent, within } from 'storybook/test'; import NextHeader from './NextHeader'; diff --git a/code/frameworks/nextjs/template/stories_nextjs-default-ts/Redirect.stories.tsx b/code/frameworks/nextjs/template/stories_nextjs-default-ts/Redirect.stories.tsx index 3c5980b7975..3f8c378ee22 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-default-ts/Redirect.stories.tsx +++ b/code/frameworks/nextjs/template/stories_nextjs-default-ts/Redirect.stories.tsx @@ -1,9 +1,9 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { userEvent, within } from '@storybook/test'; import { redirect } from 'next/navigation'; +import { userEvent, within } from 'storybook/test'; let state = 'Bug! Not invalidated'; diff --git a/code/frameworks/nextjs/template/stories_nextjs-default-ts/ServerActions.stories.tsx b/code/frameworks/nextjs/template/stories_nextjs-default-ts/ServerActions.stories.tsx index f1a9ad762ee..1f4c8979fb0 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-default-ts/ServerActions.stories.tsx +++ b/code/frameworks/nextjs/template/stories_nextjs-default-ts/ServerActions.stories.tsx @@ -4,7 +4,8 @@ import { revalidatePath } from '@storybook/nextjs/cache.mock'; import { cookies } from '@storybook/nextjs/headers.mock'; import { getRouter, redirect } from '@storybook/nextjs/navigation.mock'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, waitFor, within } from '@storybook/test'; + +import { expect, userEvent, waitFor, within } from 'storybook/test'; import { accessRoute, login, logout } from './server-actions'; diff --git a/code/frameworks/nextjs/template/stories_nextjs-prerelease/NextHeader.stories.tsx b/code/frameworks/nextjs/template/stories_nextjs-prerelease/NextHeader.stories.tsx index f5e83ef867f..040154706aa 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-prerelease/NextHeader.stories.tsx +++ b/code/frameworks/nextjs/template/stories_nextjs-prerelease/NextHeader.stories.tsx @@ -1,6 +1,7 @@ import { cookies, headers } from '@storybook/nextjs/headers.mock'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; + +import { expect, userEvent, within } from 'storybook/test'; import NextHeader from './NextHeader'; diff --git a/code/frameworks/nextjs/template/stories_nextjs-prerelease/Redirect.stories.tsx b/code/frameworks/nextjs/template/stories_nextjs-prerelease/Redirect.stories.tsx index 3c5980b7975..3f8c378ee22 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-prerelease/Redirect.stories.tsx +++ b/code/frameworks/nextjs/template/stories_nextjs-prerelease/Redirect.stories.tsx @@ -1,9 +1,9 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { userEvent, within } from '@storybook/test'; import { redirect } from 'next/navigation'; +import { userEvent, within } from 'storybook/test'; let state = 'Bug! Not invalidated'; diff --git a/code/frameworks/nextjs/template/stories_nextjs-prerelease/ServerActions.stories.tsx b/code/frameworks/nextjs/template/stories_nextjs-prerelease/ServerActions.stories.tsx index f1a9ad762ee..1f4c8979fb0 100644 --- a/code/frameworks/nextjs/template/stories_nextjs-prerelease/ServerActions.stories.tsx +++ b/code/frameworks/nextjs/template/stories_nextjs-prerelease/ServerActions.stories.tsx @@ -4,7 +4,8 @@ import { revalidatePath } from '@storybook/nextjs/cache.mock'; import { cookies } from '@storybook/nextjs/headers.mock'; import { getRouter, redirect } from '@storybook/nextjs/navigation.mock'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, userEvent, waitFor, within } from '@storybook/test'; + +import { expect, userEvent, waitFor, within } from 'storybook/test'; import { accessRoute, login, logout } from './server-actions'; diff --git a/code/frameworks/react-native-web-vite/template/cli/js/Button.stories.jsx b/code/frameworks/react-native-web-vite/template/cli/js/Button.stories.jsx index b7136fd8ae6..3ea891e65ce 100644 --- a/code/frameworks/react-native-web-vite/template/cli/js/Button.stories.jsx +++ b/code/frameworks/react-native-web-vite/template/cli/js/Button.stories.jsx @@ -1,6 +1,5 @@ -import { fn } from '@storybook/test'; - import { View } from 'react-native'; +import { fn } from 'storybook/test'; import { Button } from './Button'; diff --git a/code/frameworks/react-native-web-vite/template/cli/js/Page.stories.jsx b/code/frameworks/react-native-web-vite/template/cli/js/Page.stories.jsx index 249647fce86..bbf8729b8a3 100644 --- a/code/frameworks/react-native-web-vite/template/cli/js/Page.stories.jsx +++ b/code/frameworks/react-native-web-vite/template/cli/js/Page.stories.jsx @@ -1,4 +1,4 @@ -import { expect, userEvent, within } from '@storybook/test'; +import { expect, userEvent, within } from 'storybook/test'; import { Page } from './Page'; diff --git a/code/frameworks/react-native-web-vite/template/cli/ts-4-9/Button.stories.tsx b/code/frameworks/react-native-web-vite/template/cli/ts-4-9/Button.stories.tsx index 8e655fbfe26..cb852dfbe40 100644 --- a/code/frameworks/react-native-web-vite/template/cli/ts-4-9/Button.stories.tsx +++ b/code/frameworks/react-native-web-vite/template/cli/ts-4-9/Button.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; import { View } from 'react-native'; +import { fn } from 'storybook/test'; import { Button } from './Button'; diff --git a/code/frameworks/react-native-web-vite/template/cli/ts-4-9/Page.stories.tsx b/code/frameworks/react-native-web-vite/template/cli/ts-4-9/Page.stories.tsx index 5a5db7ff268..86fc96ded9f 100644 --- a/code/frameworks/react-native-web-vite/template/cli/ts-4-9/Page.stories.tsx +++ b/code/frameworks/react-native-web-vite/template/cli/ts-4-9/Page.stories.tsx @@ -1,5 +1,6 @@ import type { Meta } from '@storybook/react'; -import { expect, userEvent, within } from '@storybook/test'; + +import { expect, userEvent, within } from 'storybook/test'; import { Page } from './Page'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/forms.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/forms.stories.js index baff059fa21..a60865e1d17 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/forms.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/forms.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Forms from './Forms.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/hrefs.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/hrefs.stories.js index 9f7033e36a3..e5517ce62f8 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/hrefs.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/hrefs.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Hrefs from './Hrefs.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/navigation.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/navigation.stories.js index e102fce9643..cde66fd4f5a 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/navigation.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-prerelease-ts/navigation.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Navigation from './Navigation.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/environment.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/environment.stories.js index fb4c85d9926..47f2f3a4424 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/environment.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/environment.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Environment from './Environment.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/forms.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/forms.stories.js index 7659291df4f..6a020c8e124 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/forms.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/forms.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, userEvent, within } from '@storybook/test'; +import { expect, fn, userEvent, within } from 'storybook/test'; import Forms from './Forms.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/hrefs.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/hrefs.stories.js index 9f7033e36a3..e5517ce62f8 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/hrefs.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/hrefs.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Hrefs from './Hrefs.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/navigation.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/navigation.stories.js index e102fce9643..cde66fd4f5a 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/navigation.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/navigation.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Navigation from './Navigation.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/paths.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/paths.stories.js index 4ef5ddbcb54..1c6d5f362c5 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/paths.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-js/paths.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Paths from './Paths.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/environment.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/environment.stories.js index fb4c85d9926..47f2f3a4424 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/environment.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/environment.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Environment from './Environment.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/forms.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/forms.stories.js index baff059fa21..a60865e1d17 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/forms.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/forms.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Forms from './Forms.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/hrefs.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/hrefs.stories.js index 9f7033e36a3..e5517ce62f8 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/hrefs.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/hrefs.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Hrefs from './Hrefs.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/navigation.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/navigation.stories.js index e102fce9643..cde66fd4f5a 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/navigation.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/navigation.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Navigation from './Navigation.svelte'; diff --git a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/paths.stories.js b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/paths.stories.js index 4ef5ddbcb54..1c6d5f362c5 100644 --- a/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/paths.stories.js +++ b/code/frameworks/sveltekit/template/stories_svelte-kit-skeleton-ts/paths.stories.js @@ -1,4 +1,4 @@ -import { expect, fn, within } from '@storybook/test'; +import { expect, fn, within } from 'storybook/test'; import Paths from './Paths.svelte'; diff --git a/code/lib/blocks/src/blocks/ArgTypes.stories.tsx b/code/lib/blocks/src/blocks/ArgTypes.stories.tsx index 7738bde257e..52a78f46c39 100644 --- a/code/lib/blocks/src/blocks/ArgTypes.stories.tsx +++ b/code/lib/blocks/src/blocks/ArgTypes.stories.tsx @@ -3,7 +3,8 @@ import React from 'react'; import type { PlayFunctionContext } from 'storybook/internal/csf'; import type { Meta, StoryObj } from '@storybook/react'; -import { within } from '@storybook/test'; + +import { within } from 'storybook/test'; import * as ExampleStories from '../examples/ArgTypesParameters.stories'; import * as SubcomponentsExampleStories from '../examples/ArgTypesWithSubcomponentsParameters.stories'; diff --git a/code/lib/blocks/src/blocks/Controls.stories.tsx b/code/lib/blocks/src/blocks/Controls.stories.tsx index 624f03452b8..657cc45bf11 100644 --- a/code/lib/blocks/src/blocks/Controls.stories.tsx +++ b/code/lib/blocks/src/blocks/Controls.stories.tsx @@ -3,7 +3,8 @@ import React from 'react'; import type { PlayFunctionContext } from 'storybook/internal/csf'; import type { Meta, StoryObj } from '@storybook/react'; -import { within } from '@storybook/test'; + +import { within } from 'storybook/test'; import * as ExampleStories from '../examples/ControlsParameters.stories'; import * as SubcomponentsExampleStories from '../examples/ControlsWithSubcomponentsParameters.stories'; diff --git a/code/lib/blocks/src/blocks/Story.stories.tsx b/code/lib/blocks/src/blocks/Story.stories.tsx index 370262bf0f2..4b3c006c212 100644 --- a/code/lib/blocks/src/blocks/Story.stories.tsx +++ b/code/lib/blocks/src/blocks/Story.stories.tsx @@ -1,7 +1,8 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, waitFor } from '@storybook/test'; + +import { expect, waitFor } from 'storybook/test'; import * as StoryComponentStories from '../components/Story.stories'; import * as ButtonStories from '../examples/Button.stories'; diff --git a/code/lib/blocks/src/components/Story.stories.tsx b/code/lib/blocks/src/components/Story.stories.tsx index 09e64a2dd1d..4622d5ba669 100644 --- a/code/lib/blocks/src/components/Story.stories.tsx +++ b/code/lib/blocks/src/components/Story.stories.tsx @@ -11,7 +11,8 @@ import type { PreviewWeb } from 'storybook/internal/preview-api'; import type { ModuleExport, WebRenderer } from 'storybook/internal/types'; import type { Meta, ReactRenderer, StoryObj } from '@storybook/react'; -import { within } from '@storybook/test'; + +import { within } from 'storybook/test'; import type { DocsContextProps } from '../blocks'; import * as ButtonStories from '../examples/Button.stories'; diff --git a/code/lib/blocks/src/controls/Boolean.stories.tsx b/code/lib/blocks/src/controls/Boolean.stories.tsx index ad7365c0383..26b2d6c05bd 100644 --- a/code/lib/blocks/src/controls/Boolean.stories.tsx +++ b/code/lib/blocks/src/controls/Boolean.stories.tsx @@ -2,7 +2,8 @@ import { RESET_STORY_ARGS, STORY_ARGS_UPDATED } from 'storybook/internal/core-ev import { addons } from 'storybook/internal/preview-api'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, fireEvent, fn, waitFor, within } from '@storybook/test'; + +import { expect, fireEvent, fn, waitFor, within } from 'storybook/test'; import { BooleanControl } from './Boolean'; diff --git a/code/lib/blocks/src/controls/Color.stories.tsx b/code/lib/blocks/src/controls/Color.stories.tsx index 8b77cff62f0..0784d0b9880 100644 --- a/code/lib/blocks/src/controls/Color.stories.tsx +++ b/code/lib/blocks/src/controls/Color.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { ColorControl } from './Color'; diff --git a/code/lib/blocks/src/controls/Date.stories.tsx b/code/lib/blocks/src/controls/Date.stories.tsx index c2fcb33e39b..a0c75b0c049 100644 --- a/code/lib/blocks/src/controls/Date.stories.tsx +++ b/code/lib/blocks/src/controls/Date.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { DateControl } from './Date'; diff --git a/code/lib/blocks/src/controls/Files.stories.tsx b/code/lib/blocks/src/controls/Files.stories.tsx index 640f954260c..8fad76248f0 100644 --- a/code/lib/blocks/src/controls/Files.stories.tsx +++ b/code/lib/blocks/src/controls/Files.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { FilesControl } from './Files'; diff --git a/code/lib/blocks/src/controls/Number.stories.tsx b/code/lib/blocks/src/controls/Number.stories.tsx index 80bde03aeef..da481a7e8f6 100644 --- a/code/lib/blocks/src/controls/Number.stories.tsx +++ b/code/lib/blocks/src/controls/Number.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { NumberControl } from './Number'; diff --git a/code/lib/blocks/src/controls/Object.stories.tsx b/code/lib/blocks/src/controls/Object.stories.tsx index 0929234e3ad..66db97ee45f 100644 --- a/code/lib/blocks/src/controls/Object.stories.tsx +++ b/code/lib/blocks/src/controls/Object.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { ObjectControl } from './Object'; diff --git a/code/lib/blocks/src/controls/Range.stories.tsx b/code/lib/blocks/src/controls/Range.stories.tsx index cd8ca20c522..09101039665 100644 --- a/code/lib/blocks/src/controls/Range.stories.tsx +++ b/code/lib/blocks/src/controls/Range.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { RangeControl } from './Range'; diff --git a/code/lib/blocks/src/controls/Text.stories.tsx b/code/lib/blocks/src/controls/Text.stories.tsx index 71dee59dc19..aa125efec4e 100644 --- a/code/lib/blocks/src/controls/Text.stories.tsx +++ b/code/lib/blocks/src/controls/Text.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { TextControl } from './Text'; diff --git a/code/lib/blocks/src/controls/options/CheckOptions.stories.tsx b/code/lib/blocks/src/controls/options/CheckOptions.stories.tsx index 8e98d88c080..4b71463fb84 100644 --- a/code/lib/blocks/src/controls/options/CheckOptions.stories.tsx +++ b/code/lib/blocks/src/controls/options/CheckOptions.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { OptionsControl } from './Options'; diff --git a/code/lib/blocks/src/controls/options/RadioOptions.stories.tsx b/code/lib/blocks/src/controls/options/RadioOptions.stories.tsx index e96f52b781c..bbbb1607d29 100644 --- a/code/lib/blocks/src/controls/options/RadioOptions.stories.tsx +++ b/code/lib/blocks/src/controls/options/RadioOptions.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { OptionsControl } from './Options'; diff --git a/code/lib/blocks/src/controls/options/SelectOptions.stories.tsx b/code/lib/blocks/src/controls/options/SelectOptions.stories.tsx index 81efc451c7f..805d2cde9ce 100644 --- a/code/lib/blocks/src/controls/options/SelectOptions.stories.tsx +++ b/code/lib/blocks/src/controls/options/SelectOptions.stories.tsx @@ -1,5 +1,6 @@ import type { Meta, StoryObj } from '@storybook/react'; -import { fn } from '@storybook/test'; + +import { fn } from 'storybook/test'; import { OptionsControl } from './Options'; diff --git a/code/lib/blocks/src/examples/Button.stories.tsx b/code/lib/blocks/src/examples/Button.stories.tsx index c22d141f541..f290f66e136 100644 --- a/code/lib/blocks/src/examples/Button.stories.tsx +++ b/code/lib/blocks/src/examples/Button.stories.tsx @@ -2,7 +2,8 @@ import React from 'react'; import type { Meta, StoryObj } from '@storybook/react'; -import { expect, fireEvent, within } from '@storybook/test'; + +import { expect, fireEvent, within } from 'storybook/test'; import { Button } from './Button'; diff --git a/code/lib/codemod/src/transforms/__tests__/migrate-to-test-package.test.ts b/code/lib/codemod/src/transforms/__tests__/migrate-to-test-package.test.ts index e3c2b2e517f..5207181e37a 100644 --- a/code/lib/codemod/src/transforms/__tests__/migrate-to-test-package.test.ts +++ b/code/lib/codemod/src/transforms/__tests__/migrate-to-test-package.test.ts @@ -19,8 +19,8 @@ test('replace jest and testing-library with the test package', async () => { `; expect(await tsTransform(input)).toMatchInlineSnapshot(` - import { expect } from '@storybook/test'; - import { userEvent, within } from '@storybook/test'; + import { expect } from 'storybook/test'; + import { userEvent, within } from 'storybook/test'; `); }); @@ -36,9 +36,9 @@ test('Make jest imports namespace imports', async () => { `; expect(await tsTransform(input)).toMatchInlineSnapshot(` - import { expect } from '@storybook/test'; - import * as test from '@storybook/test'; - import { userEvent, within } from '@storybook/test'; + import { expect } from 'storybook/test'; + import * as test from 'storybook/test'; + import { userEvent, within } from 'storybook/test'; const onFocusMock = test.fn(); const onSearchMock = test.fn(); diff --git a/code/renderers/svelte/template/cli/svelte-5-js/Button.stories.svelte b/code/renderers/svelte/template/cli/svelte-5-js/Button.stories.svelte index 4c8c7cce632..e6fb72dac17 100644 --- a/code/renderers/svelte/template/cli/svelte-5-js/Button.stories.svelte +++ b/code/renderers/svelte/template/cli/svelte-5-js/Button.stories.svelte @@ -1,7 +1,7 @@