-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 #19879 from storybookjs/chore_docs_snippets_remove…
…_screen_refs Chore: (Docs) Interaction tests docs updates for CSF 3
- Loading branch information
Showing
56 changed files
with
519 additions
and
316 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
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 |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
import type { Meta, StoryObj } from '@storybook/angular'; | ||
|
||
import { screen, userEvent } from '@storybook/testing-library'; | ||
import { userEvent, within } from '@storybook/testing-library'; | ||
|
||
import { RegistrationForm } from './RegistrationForm.component'; | ||
|
||
|
@@ -19,25 +19,31 @@ const meta: Meta<RegistrationForm> = { | |
export default meta; | ||
type Story = StoryObj<RegistrationForm>; | ||
|
||
/* | ||
* See https://storybook.js.org/docs/7.0/angular/writing-stories/play-function#working-with-the-canvas | ||
* to learn more about using the canvasElement to query the DOM | ||
*/ | ||
export const FilledForm: Story = { | ||
play: async () => { | ||
const emailInput = screen.getByLabelText('email', { | ||
play: async ({ canvasElement }) => { | ||
const canvas = within(canvasElement); | ||
|
||
const emailInput = canvas.getByLabelText('email', { | ||
selector: 'input', | ||
}); | ||
|
||
await userEvent.type(emailInput, '[email protected]', { | ||
delay: 100, | ||
}); | ||
|
||
const passwordInput = screen.getByLabelText('password', { | ||
const passwordInput = canvas.getByLabelText('password', { | ||
selector: 'input', | ||
}); | ||
|
||
await userEvent.type(passwordInput, 'ExamplePassword', { | ||
delay: 100, | ||
}); | ||
// See https://storybook.js.org/docs/7.0/angular/essentials/actions#automatically-matching-args to learn how to setup logging in the Actions panel | ||
const submitButton = screen.getByRole('button'); | ||
const submitButton = canvas.getByRole('button'); | ||
|
||
await userEvent.click(submitButton); | ||
}, | ||
|
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
Oops, something went wrong.