Skip to content

Commit

Permalink
Merge pull request #20982 from storybookjs/norbert/default-background
Browse files Browse the repository at this point in the history
Tech: add a default background to newly initialized storybooks
  • Loading branch information
ndelangen authored Feb 7, 2023
2 parents d7c648f + 30816d0 commit 6c46a3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions code/lib/cli/src/generators/configure.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ describe('configurePreview', () => {
expect(previewConfigPath).toEqual('./.storybook/preview.js');
expect(previewConfigContent).toMatchInlineSnapshot(`
"export const parameters = {
backgrounds: {
default: 'light',
},
actions: { argTypesRegex: \\"^on[A-Z].*\\" },
controls: {
matchers: {
Expand All @@ -108,6 +111,9 @@ describe('configurePreview', () => {
expect(previewConfigPath).toEqual('./.storybook/preview.ts');
expect(previewConfigContent).toMatchInlineSnapshot(`
"export const parameters = {
backgrounds: {
default: 'light',
},
actions: { argTypesRegex: \\"^on[A-Z].*\\" },
controls: {
matchers: {
Expand Down Expand Up @@ -150,6 +156,9 @@ describe('configurePreview', () => {
import docJson from \\"../documentation.json\\";
setCompodocJson(docJson);
export const parameters = {
backgrounds: {
default: 'light',
},
actions: { argTypesRegex: \\"^on[A-Z].*\\" },
controls: {
matchers: {
Expand Down
3 changes: 3 additions & 0 deletions code/lib/cli/src/generators/configure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export async function configurePreview(options: ConfigurePreviewOptions) {
const preview = dedent`
${prefix}
export const parameters = {
backgrounds: {
default: 'light',
},
actions: { argTypesRegex: "^on[A-Z].*" },
controls: {
matchers: {
Expand Down

0 comments on commit 6c46a3d

Please sign in to comment.