-
-
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 #18737 from storybookjs/fix-react-18-docs-tests
React: Fix callback behavior in `react@18`
- Loading branch information
Showing
2 changed files
with
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { skipOn } from '@cypress/skip-test'; | ||
|
||
describe('addon-docs', () => { | ||
beforeEach(() => { | ||
cy.visitStorybook(); | ||
cy.navigateToStory('example-button', 'docs'); | ||
}); | ||
|
||
skipOn('vue3', () => { | ||
skipOn('html', () => { | ||
it('should provide source snippet', () => { | ||
cy.getDocsElement() | ||
.find('.docblock-code-toggle') | ||
.each(($div) => { | ||
cy.wrap($div) | ||
.should('contain.text', 'Show code') | ||
// use force click so cypress does not automatically scroll, making the source block visible on this step | ||
.click({ force: true }); | ||
}); | ||
|
||
cy.getDocsElement() | ||
.find('pre.prismjs') | ||
.each(($div) => { | ||
const text = $div.text(); | ||
expect(text).not.match(/^\(args\) => /); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |