diff --git a/src/App.tsx b/src/App.tsx index 636ebcc53627..34193879efbd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,6 +1,5 @@ import React, { useCallback, useEffect, useState } from "react"; import { ThemeProvider, ensure, themes } from "@storybook/theming"; -import { STORY_CHANGED } from "@storybook/core-events"; import { addons, type API } from "@storybook/manager-api"; import { GuidedTour } from "./features/GuidedTour/GuidedTour"; @@ -72,34 +71,37 @@ export default function App({ api }: { api: API }) { }} /> )} - setStep("2:StorybookTour")} - isOpen={enabled && step === "1:Welcome"} - skipOnboarding={skipOnboarding} - /> - {enabled && (step === "2:StorybookTour" || step === "5:ConfigureYourProject") && ( - setStep("2:StorybookTour")} + skipOnboarding={skipOnboarding} + /> + )} + {enabled && + (step === "2:StorybookTour" || step === "5:ConfigureYourProject") && ( + { + setStep("3:WriteYourStory"); + }} + onLastTourDone={() => { + api.selectStory("configure-your-project--docs"); + skipOnboarding(); + }} + /> + )} + {enabled && step === "3:WriteYourStory" && ( + { - setStep("3:WriteYourStory"); - }} - onLastTourDone={() => { - api.selectStory("configure-your-project--docs"); - skipOnboarding(); + addonsStore={addons} + onFinish={() => { + api.selectStory("example-button--warning"); + setStep("4:VisitNewStory"); }} + skipOnboarding={skipOnboarding} /> )} - { - api.selectStory("example-button--warning"); - setStep("4:VisitNewStory"); - }} - isOpen={enabled && step === "3:WriteYourStory"} - skipOnboarding={skipOnboarding} - /> ); } diff --git a/src/features/WriteStoriesModal/WriteStoriesModal.stories.tsx b/src/features/WriteStoriesModal/WriteStoriesModal.stories.tsx index 1aa9896f5805..cb10e43bca56 100644 --- a/src/features/WriteStoriesModal/WriteStoriesModal.stories.tsx +++ b/src/features/WriteStoriesModal/WriteStoriesModal.stories.tsx @@ -9,7 +9,7 @@ import { STORY_RENDERED, } from "@storybook/core-events"; -const getData = jest.fn() +const getData = jest.fn(); const meta: Meta = { component: WriteStoriesModal, @@ -33,7 +33,7 @@ const meta: Meta = { storyIndexInvalidatedCb = cb; } }, - off: () => { }, + off: () => {}, }), } as any, }, @@ -43,10 +43,10 @@ const meta: Meta = { // do not respond to the first call, this would only return the data correctly if the story already exists // which is not the case in this story, it only makes sense in the real scenario .mockReturnValueOnce(null) - .mockReturnValueOnce({ some: "data" }) + .mockReturnValueOnce({ some: "data" }); return (
{storyFn()}
- ) + ); }, ], }; @@ -57,11 +57,7 @@ type Story = StoryObj; let storyIndexInvalidatedCb: () => void; -export const Default: Story = { - args: { - isOpen: true, - }, -}; +export const Default: Story = {}; export const DefaultPlayed: Story = { args: {