generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #126 from chromaui/matt/ap-3618-git-is-required-fo…
…r-visual-test-addon-via-chromatic-cli git is required for visual test addon via chromatic cli
- Loading branch information
Showing
6 changed files
with
134 additions
and
12 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,17 @@ | ||
import type { Meta, StoryObj } from "@storybook/react"; | ||
import React from "react"; | ||
|
||
import { storyWrapper } from "../../utils/graphQLClient"; | ||
import { GitNotFound } from "./GitNotFound"; | ||
|
||
const meta = { | ||
component: GitNotFound, | ||
decorators: [storyWrapper], | ||
args: { | ||
gitInfoError: new Error("Git info not found"), | ||
}, | ||
} satisfies Meta<typeof GitNotFound>; | ||
|
||
export const Default = {} satisfies StoryObj<typeof meta>; | ||
|
||
export default meta; |
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,58 @@ | ||
import { Icon, Link } from "@storybook/design-system"; | ||
import { styled } from "@storybook/theming"; | ||
import React from "react"; | ||
|
||
import { Container } from "../../components/Container"; | ||
import { Heading } from "../../components/Heading"; | ||
import { VisualTestsIcon } from "../../components/icons/VisualTestsIcon"; | ||
import { Section } from "../../components/layout"; | ||
import { Stack } from "../../components/Stack"; | ||
import { Text } from "../../components/Text"; | ||
|
||
interface GitNotFoundProps { | ||
gitInfoError: Error; | ||
} | ||
|
||
const InfoSection = styled(Section)(({ theme }) => ({ | ||
display: "flex", | ||
flexDirection: "row", | ||
alignItems: "center", | ||
borderRadius: theme.appBorderRadius, | ||
background: theme.color.lightest, | ||
padding: 15, | ||
flex: 1, | ||
boxShadow: `0px 1px 3px 0px rgba(0, 0, 0, 0.10), 0px 2px 5px 0px rgba(0, 0, 0, 0.05)`, | ||
})); | ||
|
||
const InfoSectionText = styled(Text)(({ theme }) => ({ | ||
marginLeft: 14, | ||
flex: 1, | ||
textAlign: "left", | ||
color: theme.color.darker, | ||
})); | ||
|
||
export const GitNotFound = ({ gitInfoError }: GitNotFoundProps) => ( | ||
<Container> | ||
<Stack> | ||
<div> | ||
<VisualTestsIcon /> | ||
<Heading>Visual tests</Heading> | ||
<Text> | ||
Catch bugs in UI appearance automatically. Compare image snapshots to detect visual | ||
changes. | ||
</Text> | ||
</div> | ||
<InfoSection> | ||
<Icon icon="lock" /> | ||
<InfoSectionText> | ||
<b>Git not detected</b> | ||
<br /> | ||
This addon requires Git to associate test results with commits and branches. | ||
</InfoSectionText> | ||
</InfoSection> | ||
<Link target="_new" href="https://www.chromatic.com/docs/cli/" withArrow> | ||
Visual tests requirements | ||
</Link> | ||
</Stack> | ||
</Container> | ||
); |