Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chromatic strategy #63

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as React from "react"
import type { Preview } from "@storybook/react"
import { ResetStyle } from "../src/lib/style/reset-style"
import { ligthTheme } from "../src/features/theme/theme"
import { disabledSnapshot } from "../src/lib/test/chromatic"
import { ThemeProvider } from "styled-components"

const preview: Preview = {
Expand All @@ -20,6 +21,7 @@ const preview: Preview = {
query: {},
},
},
...disabledSnapshot,
},
decorators: [
(Story) => (
Expand Down
1 change: 1 addition & 0 deletions src/lib/test/chromatic/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { enabledSnapshot, disabledSnapshot } from "./parameters"
21 changes: 21 additions & 0 deletions src/lib/test/chromatic/parameters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* @example
* ```typescript
* export const StoryName = {
* parameters: {
* ...enabledSnapshot
* }
* }
* ```
*/
export const enabledSnapshot = {
chromatic: {
disableSnapshot: false,
},
} as const

export const disabledSnapshot = {
chromatic: {
disableSnapshot: true,
},
} as const