-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
/
navigation.spec.ts
37 lines (28 loc) · 1.16 KB
/
navigation.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { visit } from '../helper';
describe('Navigation', () => {
before(() => {
visit('official-storybook');
});
it('should search navigation item', () => {
cy.get('#storybook-explorer-searchfield').click();
cy.get('#storybook-explorer-searchfield').clear().type('syntax');
cy.get('#storybook-explorer-menu button')
.should('contain', 'SyntaxHighlighter')
.and('not.contain', 'a11y');
});
it('should display no results after searching a non-existing navigation item', () => {
cy.get('#storybook-explorer-searchfield').click().clear().type('zzzzzzzzzz');
cy.get('#storybook-explorer-menu button').should('be.hidden');
});
});
describe('Routing', () => {
it('should navigate to story addons-a11y-basebutton--default', () => {
visit('official-storybook');
cy.get('#addons-a11y-basebutton--label').click();
cy.url().should('include', 'path=/story/addons-a11y-basebutton--label');
});
it('should directly visit a certain story and render correctly', () => {
visit('official-storybook/?path=/story/addons-a11y-basebutton--label');
cy.getStoryElement().should('contain.text', 'Testing the a11y addon');
});
});