forked from storybookjs/storybook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
addon-interactions.spec.ts
57 lines (44 loc) 路 1.36 KB
/
addon-interactions.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* eslint-disable jest/no-identical-title */
import { onlyOn } from '@cypress/skip-test';
describe('addon-interactions', () => {
before(() => {
cy.visitStorybook();
});
const test = () => {
// click on the button
cy.navigateToStory('example-page', 'logged-in');
cy.viewAddonPanel('Interactions');
cy.getStoryElement().find('.welcome').should('contain.text', 'Welcome, Jane Doe!');
cy.get('#tabbutton-interactions').contains(/(1)/).should('be.visible');
cy.get('#storybook-panel-root')
.contains(/userEvent.click/)
.should('be.visible');
cy.get('[data-testid=icon-done]').should('be.visible');
};
// Having multiple of onlyOn for the same test is a workaround instead
// of having to use skipOn a long list of frameworks
onlyOn('angular', () => {
it('should have interactions', test);
});
onlyOn('react', () => {
it('should have interactions', test);
});
onlyOn('vite_react', () => {
it('should have interactions', test);
});
onlyOn('preact', () => {
it('should have interactions', test);
});
onlyOn('html', () => {
it('should have interactions', test);
});
onlyOn('svelte', () => {
it('should have interactions', test);
});
onlyOn('vue3', () => {
it('should have interactions', test);
});
onlyOn('vue', () => {
it('should have interactions', test);
});
});