-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(storybook): updated tests and snapshots
- Loading branch information
Showing
12 changed files
with
734 additions
and
166 deletions.
There are no files selected for viewing
446 changes: 366 additions & 80 deletions
446
packages/react/src/generators/component-story/__snapshots__/component-story.spec.ts.snap
Large diffs are not rendered by default.
Oops, something went wrong.
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
100 changes: 100 additions & 0 deletions
100
packages/react/src/generators/stories/__snapshots__/stories.app.spec.ts.snap
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,100 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`react:stories for applications should create the stories with interaction tests 1`] = ` | ||
"import type { Meta, StoryObj } from '@storybook/react'; | ||
import { NxWelcome } from './nx-welcome'; | ||
import { within } from '@storybook/testing-library'; | ||
import { expect } from '@storybook/jest'; | ||
const meta: Meta<typeof NxWelcome> = { | ||
component: NxWelcome, | ||
title: 'NxWelcome', | ||
}; | ||
export default meta; | ||
type Story = StoryObj<typeof NxWelcome>; | ||
export const Primary = { | ||
args: {}, | ||
}; | ||
export const Heading: Story = { | ||
play: async ({ canvasElement }) => { | ||
const canvas = within(canvasElement); | ||
expect(canvas.getByText(/Welcome to NxWelcome!/gi)).toBeTruthy(); | ||
}, | ||
}; | ||
" | ||
`; | ||
exports[`react:stories for applications should create the stories with interaction tests 2`] = ` | ||
"import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Test } from './another-cmp'; | ||
import { within } from '@storybook/testing-library'; | ||
import { expect } from '@storybook/jest'; | ||
const meta: Meta<typeof Test> = { | ||
component: Test, | ||
title: 'Test', | ||
}; | ||
export default meta; | ||
type Story = StoryObj<typeof Test>; | ||
export const Primary = { | ||
args: { | ||
name: '', | ||
displayAge: false, | ||
}, | ||
}; | ||
export const Heading: Story = { | ||
play: async ({ canvasElement }) => { | ||
const canvas = within(canvasElement); | ||
expect(canvas.getByText(/Welcome to Test!/gi)).toBeTruthy(); | ||
}, | ||
}; | ||
" | ||
`; | ||
exports[`react:stories for applications should create the stories without interaction tests 1`] = ` | ||
"import type { Meta, StoryObj } from '@storybook/react'; | ||
import { NxWelcome } from './nx-welcome'; | ||
const meta: Meta<typeof NxWelcome> = { | ||
component: NxWelcome, | ||
title: 'NxWelcome', | ||
}; | ||
export default meta; | ||
type Story = StoryObj<typeof NxWelcome>; | ||
export const Primary = { | ||
args: {}, | ||
}; | ||
" | ||
`; | ||
exports[`react:stories for applications should create the stories without interaction tests 2`] = ` | ||
"import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Test } from './another-cmp'; | ||
const meta: Meta<typeof Test> = { | ||
component: Test, | ||
title: 'Test', | ||
}; | ||
export default meta; | ||
type Story = StoryObj<typeof Test>; | ||
export const Primary = { | ||
args: { | ||
name: '', | ||
displayAge: false, | ||
}, | ||
}; | ||
" | ||
`; | ||
exports[`react:stories for applications should not update existing stories 1`] = ` | ||
"import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
" | ||
`; |
95 changes: 95 additions & 0 deletions
95
packages/react/src/generators/stories/__snapshots__/stories.lib.spec.ts.snap
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,95 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`react:stories for libraries should create the stories with interaction tests 1`] = ` | ||
"import type { Meta, StoryObj } from '@storybook/react'; | ||
import { TestUiLib } from './test-ui-lib'; | ||
import { within } from '@storybook/testing-library'; | ||
import { expect } from '@storybook/jest'; | ||
const meta: Meta<typeof TestUiLib> = { | ||
component: TestUiLib, | ||
title: 'TestUiLib', | ||
}; | ||
export default meta; | ||
type Story = StoryObj<typeof TestUiLib>; | ||
export const Primary = { | ||
args: {}, | ||
}; | ||
export const Heading: Story = { | ||
play: async ({ canvasElement }) => { | ||
const canvas = within(canvasElement); | ||
expect(canvas.getByText(/Welcome to TestUiLib!/gi)).toBeTruthy(); | ||
}, | ||
}; | ||
" | ||
`; | ||
exports[`react:stories for libraries should create the stories with interaction tests 2`] = ` | ||
"import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Test } from './another-cmp'; | ||
import { within } from '@storybook/testing-library'; | ||
import { expect } from '@storybook/jest'; | ||
const meta: Meta<typeof Test> = { | ||
component: Test, | ||
title: 'Test', | ||
}; | ||
export default meta; | ||
type Story = StoryObj<typeof Test>; | ||
export const Primary = { | ||
args: { | ||
name: '', | ||
displayAge: false, | ||
}, | ||
}; | ||
export const Heading: Story = { | ||
play: async ({ canvasElement }) => { | ||
const canvas = within(canvasElement); | ||
expect(canvas.getByText(/Welcome to Test!/gi)).toBeTruthy(); | ||
}, | ||
}; | ||
" | ||
`; | ||
exports[`react:stories for libraries should create the stories without interaction tests 1`] = ` | ||
"import type { Meta, StoryObj } from '@storybook/react'; | ||
import { TestUiLib } from './test-ui-lib'; | ||
const meta: Meta<typeof TestUiLib> = { | ||
component: TestUiLib, | ||
title: 'TestUiLib', | ||
}; | ||
export default meta; | ||
type Story = StoryObj<typeof TestUiLib>; | ||
export const Primary = { | ||
args: {}, | ||
}; | ||
" | ||
`; | ||
exports[`react:stories for libraries should create the stories without interaction tests 2`] = ` | ||
"import type { Meta, StoryObj } from '@storybook/react'; | ||
import { Test } from './another-cmp'; | ||
const meta: Meta<typeof Test> = { | ||
component: Test, | ||
title: 'Test', | ||
}; | ||
export default meta; | ||
type Story = StoryObj<typeof Test>; | ||
export const Primary = { | ||
args: { | ||
name: '', | ||
displayAge: false, | ||
}, | ||
}; | ||
" | ||
`; |
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
Oops, something went wrong.