generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 72
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 #165 from storybookjs/fix/nightly
Add nightly check for failures
- Loading branch information
Showing
7 changed files
with
151 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import { within, userEvent } from '@storybook/testing-library'; | ||
|
||
import { Page } from '../pages/Page'; | ||
|
||
export default { | ||
title: 'Stories with failures', | ||
component: Page, | ||
}; | ||
|
||
const Template = (args) => <Page {...args} />; | ||
|
||
export const ComponentThrowsErrors = () => { | ||
// throw new Error('Component has a failure'); | ||
return <div>Oi</div> | ||
} | ||
|
||
export const PlayFnThrowsErrors = Template.bind({}); | ||
PlayFnThrowsErrors.play = () => { | ||
throw new Error('Play function has a failure'); | ||
}; | ||
|
||
export const PlayFnAssertionFails = Template.bind({}); | ||
PlayFnAssertionFails.play = async ({ canvasElement }) => { | ||
const canvas = within(canvasElement); | ||
const unexistentButton = await canvas.getByRole('button', { name: /I do not exist/i }); | ||
await userEvent.click(unexistentButton); | ||
}; |