generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from chromaui/tom/ap-3562-send-main-config-loc…
…ation-on-successfailure Send mainPath and configDir on update success/failure
- Loading branch information
Showing
10 changed files
with
101 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { action } from "@storybook/addon-actions"; | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import { graphql } from "msw"; | ||
|
||
import { ProjectQueryQuery } from "../../gql/graphql"; | ||
import { storyWrapper } from "../../utils/graphQLClient"; | ||
import { withFigmaDesign } from "../../utils/withFigmaDesign"; | ||
import { LinkedProject } from "./LinkedProject"; | ||
|
||
const withGraphQLQuery = (...args: Parameters<typeof graphql.query>) => ({ | ||
msw: { | ||
handlers: [graphql.query(...args)], | ||
}, | ||
}); | ||
|
||
const meta = { | ||
component: LinkedProject, | ||
args: { | ||
projectId: "Project:abc123", | ||
mainPath: "main.ts", | ||
goToNext: action("goToNext"), | ||
setAccessToken: action("setAccessToken"), | ||
}, | ||
decorators: [storyWrapper], | ||
parameters: { | ||
...withGraphQLQuery("ProjectQuery", (req, res, ctx) => | ||
res( | ||
ctx.data({ | ||
project: { | ||
id: "789", | ||
name: "acme", | ||
webUrl: "https://www.chromatic.com/builds?appId=789", | ||
lastBuild: { | ||
branch: "main", | ||
number: 123, | ||
}, | ||
}, | ||
} satisfies ProjectQueryQuery) | ||
) | ||
), | ||
...withFigmaDesign( | ||
"https://www.figma.com/file/GFEbCgCVDtbZhngULbw2gP/Visual-testing-in-Storybook?type=design&node-id=508-317094&t=435fylbu7gUQNEgq-4" | ||
), | ||
}, | ||
} satisfies Meta<typeof LinkedProject>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters