mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
13 lines
351 B
Plaintext
13 lines
351 B
Plaintext
```js
|
|
// .storybook/test-runner.js
|
|
|
|
module.exports = {
|
|
async postVisit(page, context) {
|
|
// the #storybook-root element wraps the story. In Storybook 6.x, the selector is #root
|
|
const elementHandler = await page.$('#storybook-root');
|
|
const innerHTML = await elementHandler.innerHTML();
|
|
expect(innerHTML).toMatchSnapshot();
|
|
},
|
|
};
|
|
```
|