@comicrelief/component-library 7.19.1 → 7.19.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cypress/integration/components/atoms/button.spec.js +113 -0
- package/cypress/integration/components/atoms/buttonWithStates.spec.js +53 -0
- package/cypress/integration/components/atoms/checkbox.spec.js +68 -0
- package/cypress/integration/components/atoms/confetti.spec.js +52 -0
- package/cypress/integration/components/atoms/errorText.spec.js +51 -0
- package/cypress/integration/components/atoms/label.spec.js +104 -0
- package/cypress/integration/components/atoms/link.spec.js +207 -0
- package/cypress/integration/components/atoms/logo.spec.js +149 -0
- package/cypress/integration/components/atoms/pagination.spec.js +214 -0
- package/cypress/integration/components/atoms/picture.spec.js +147 -0
- package/cypress/integration/components/atoms/radioButton.spec.js +81 -0
- package/cypress/integration/components/atoms/richText.spec.js +75 -0
- package/cypress/integration/components/atoms/select.spec.js +89 -0
- package/cypress/integration/components/atoms/text.spec.js +180 -0
- package/cypress/integration/components/atoms/textArea.spec.js +91 -0
- package/cypress/integration/components/atoms/textInputWithDrop.spec.js +78 -0
- package/cypress/integration/components/molecules/accordion.spec.js +72 -0
- package/cypress/integration/components/molecules/articleTeaser.spec.js +110 -0
- package/cypress/integration/components/molecules/banner.spec.js +72 -0
- package/cypress/integration/components/molecules/box.spec.js +112 -0
- package/cypress/integration/components/molecules/card.spec.js +113 -0
- package/cypress/integration/components/molecules/chip.spec.js +70 -0
- package/cypress/integration/components/molecules/countdown.spec.js +73 -0
- package/cypress/integration/components/molecules/descriptor.spec.js +147 -0
- package/cypress/integration/components/molecules/doubleCopy.spec.js +81 -0
- package/cypress/integration/components/molecules/heroBanner.spec.js +71 -0
- package/cypress/integration/components/molecules/infoBanner.spec.js +71 -0
- package/cypress/integration/components/molecules/partnerLink.spec.js +70 -0
- package/cypress/integration/components/molecules/promo.spec.js +76 -0
- package/cypress/integration/components/{Molecules/SchoolLookup.spec.js → molecules/schoolLookup.spec.js} +6 -0
- package/cypress/integration/components/molecules/searchInput.spec.js +74 -0
- package/cypress/integration/components/molecules/searchResult.spec.js +202 -0
- package/cypress/integration/components/molecules/shareButton.spec.js +78 -0
- package/cypress/integration/components/molecules/simpleSchoolLookup.spec.js +84 -0
- package/cypress/integration/components/molecules/singleMessage.spec.js +537 -0
- package/cypress/integration/components/molecules/singleMessageDs.spec.js +248 -0
- package/cypress/integration/components/molecules/videoBanner.spec.js +140 -0
- package/cypress/integration/components/organisms/cookieBanner.spec.js +82 -0
- package/cypress/integration/components/organisms/footer.spec.js +166 -0
- package/dist/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +1 -1
- package/dist/components/Organisms/Footer/data/footerCopy.js +1 -1
- package/package.json +1 -1
- package/src/components/Organisms/Footer/__snapshots__/Footer.test.js.snap +1 -1
- package/src/components/Organisms/Footer/data/footerCopy.js +1 -1
- package/cypress/integration/components/Atoms/Checkbox.spec.js +0 -69
- package/cypress/integration/components/Atoms/Link.spec.js +0 -217
- package/cypress/integration/components/Atoms/Logo.spec.js +0 -155
- package/cypress/integration/components/Atoms/Pagination.spec.js +0 -217
- package/cypress/integration/components/Atoms/Picture.spec.js +0 -147
- package/cypress/integration/components/Atoms/RadioButton.spec.js +0 -81
- package/cypress/integration/components/Atoms/RichText.spec.js +0 -75
- package/cypress/integration/components/Atoms/Select.spec.js +0 -89
- package/cypress/integration/components/Atoms/Text.spec.js +0 -180
- package/cypress/integration/components/Atoms/TextArea.spec.js +0 -91
- package/cypress/integration/components/Molecules/ArticleTeaser.spec.js +0 -111
- package/cypress/integration/components/Molecules/Box.spec.js +0 -112
- package/cypress/integration/components/Molecules/Card.spec.js +0 -113
- package/cypress/integration/components/Molecules/DoubleCopy.spec.js +0 -81
- package/cypress/integration/components/Molecules/HeroBanner.spec.js +0 -71
- package/cypress/integration/components/Molecules/InfoBanner.spec.js +0 -71
- package/cypress/integration/components/Molecules/PartnerLink.spec.js +0 -70
- package/cypress/integration/components/Molecules/Promo.spec.js +0 -76
- package/cypress/integration/components/Molecules/SearchInput.spec.js +0 -74
- package/cypress/integration/components/Molecules/SearchResult.spec.js +0 -202
- package/cypress/integration/components/Molecules/ShareButton.spec.js +0 -78
- package/cypress/integration/components/Molecules/SingleMessage.spec.js +0 -537
- package/cypress/integration/components/Molecules/VideoBanner.spec.js +0 -70
- package/cypress/integration/components/Organisms/CookieBanner.spec.js +0 -82
- package/cypress/integration/components/Organisms/Footer.spec.js +0 -166
- /package/cypress/integration/components/{Atoms/Input.spec.js → atoms/input.spec.js} +0 -0
- /package/cypress/integration/components/{Atoms/SocialIcons.spec.js → atoms/socialIcons.spec.js} +0 -0
- /package/cypress/integration/components/{Molecules/CardDs.spec.js → molecules/cardDs.spec.js} +0 -0
- /package/cypress/integration/components/{Molecules/Typeahead.spec.js → molecules/typeahead.spec.js} +0 -0
- /package/cypress/integration/components/{Organisms/Donate.spec.js → organisms/donate.spec.js} +0 -0
- /package/cypress/integration/components/{Organisms/EmailSignUp.spec.js → organisms/emailSignUp.spec.js} +0 -0
- /package/cypress/integration/components/{Organisms/Header.spec.js → organisms/header.spec.js} +0 -0
- /package/cypress/integration/components/{Atoms/MarketingPreferencesDSForm.spec.js → organisms/marketingPreferencesDSForm.spec.js} +0 -0
- /package/cypress/integration/components/{Organisms/Membership.spec.js → organisms/membership.spec.js} +0 -0
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
describe('ArticleTeaser component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to articleteaser component
|
|
4
|
-
cy.visit('/#articleteaser');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.get('[data-testid="ArticleTeaser-container"] button[name="rsg-usage"]')
|
|
10
|
-
.contains('Props & methods')
|
|
11
|
-
.as('propsBtn');
|
|
12
|
-
|
|
13
|
-
cy.get('@propsBtn')
|
|
14
|
-
.closest('[class^=rsg--tabs]')
|
|
15
|
-
.as('container');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('is present', () => {
|
|
19
|
-
cy.get('@propsBtn').should('exist');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('does not show table initially', () => {
|
|
23
|
-
cy.get('@container')
|
|
24
|
-
.find('table')
|
|
25
|
-
.should('not.exist');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('shows the table on button click', () => {
|
|
29
|
-
cy.get('@propsBtn').click();
|
|
30
|
-
cy.get('@container')
|
|
31
|
-
.find('table')
|
|
32
|
-
.should('contain', 'Prop name');
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe('Article Teaser section', () => {
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
cy.get('[data-testid="ArticleTeaser-example-1"]')
|
|
39
|
-
.as('container')
|
|
40
|
-
.find('[data-preview="ArticleTeaser"]')
|
|
41
|
-
.as('preview');
|
|
42
|
-
|
|
43
|
-
cy.get('@container')
|
|
44
|
-
.find('button')
|
|
45
|
-
.contains('View Code')
|
|
46
|
-
.as('viewCodeBtn');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
//ArticleTeaser 1
|
|
50
|
-
it('renders article teaser', () => {
|
|
51
|
-
cy.get('@container')
|
|
52
|
-
.find('span')
|
|
53
|
-
.should('exist')
|
|
54
|
-
.contains(' 01 July 2019');
|
|
55
|
-
cy.get('@container')
|
|
56
|
-
.find('h3')
|
|
57
|
-
.should('exist')
|
|
58
|
-
.contains('News article');
|
|
59
|
-
cy.get('@container')
|
|
60
|
-
.find('span')
|
|
61
|
-
.should('exist')
|
|
62
|
-
.contains('4 min read');
|
|
63
|
-
|
|
64
|
-
//article teaser 2
|
|
65
|
-
cy.get('@container')
|
|
66
|
-
.find('div:nth-child(2) > article > a')
|
|
67
|
-
.as('container2')
|
|
68
|
-
.should('exist')
|
|
69
|
-
.contains('01 July 2019');
|
|
70
|
-
cy.get('@container2')
|
|
71
|
-
.find('h3')
|
|
72
|
-
.should('exist')
|
|
73
|
-
.contains('News article News article');
|
|
74
|
-
cy.get('@container2')
|
|
75
|
-
.find('span')
|
|
76
|
-
.should('exist')
|
|
77
|
-
.contains('4 min read');
|
|
78
|
-
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
//ArticleTeaser: Press Release
|
|
82
|
-
it('renders article teaser : press release', () => {
|
|
83
|
-
cy.get('[data-testid="ArticleTeaser-example-3"]')
|
|
84
|
-
.find('span')
|
|
85
|
-
.should('exist')
|
|
86
|
-
.contains('01 July 2019');
|
|
87
|
-
cy.get('[data-testid="ArticleTeaser-example-3"]')
|
|
88
|
-
.find('h3')
|
|
89
|
-
.should('exist')
|
|
90
|
-
.contains('Press Release');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('has view code button', () => {
|
|
94
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
it('shows code on click', () => {
|
|
98
|
-
cy.get('@viewCodeBtn').click();
|
|
99
|
-
cy.get('@container')
|
|
100
|
-
.find('textarea')
|
|
101
|
-
.should('exist');
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it('closes code on click', () => {
|
|
105
|
-
cy.get('@viewCodeBtn').click();
|
|
106
|
-
cy.get('@container')
|
|
107
|
-
.find('textarea')
|
|
108
|
-
.should('not.exist');
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
});
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
describe('Box component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to box component
|
|
4
|
-
cy.visit('/#box');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.get('[data-testid="Box-container"] button[name="rsg-usage"]')
|
|
10
|
-
.contains('Props & methods')
|
|
11
|
-
.as('propsBtn');
|
|
12
|
-
|
|
13
|
-
cy.get('@propsBtn')
|
|
14
|
-
.closest('[class^=rsg--tabs]')
|
|
15
|
-
.as('container');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('is present', () => {
|
|
19
|
-
cy.get('@propsBtn').should('exist');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('does not show table initially', () => {
|
|
23
|
-
cy.get('@container')
|
|
24
|
-
.find('table')
|
|
25
|
-
.should('not.exist');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('shows the table on button click', () => {
|
|
29
|
-
cy.get('@propsBtn').click();
|
|
30
|
-
cy.get('@container')
|
|
31
|
-
.find('table')
|
|
32
|
-
.should('contain', 'Prop name');
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe('Box example 1 section', () => {
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
cy.get('[data-testid="Box-example-1"]')
|
|
39
|
-
.as('container')
|
|
40
|
-
.find('[data-preview="Box"]')
|
|
41
|
-
.as('preview');
|
|
42
|
-
|
|
43
|
-
cy.get('@container')
|
|
44
|
-
.find('button')
|
|
45
|
-
.contains('View Code')
|
|
46
|
-
.as('viewCodeBtn');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('renders box preview', () => {
|
|
50
|
-
cy.get('@container')
|
|
51
|
-
.find('h3')
|
|
52
|
-
.should('exist')
|
|
53
|
-
.contains('Title');
|
|
54
|
-
cy.get('@container')
|
|
55
|
-
.find('p')
|
|
56
|
-
.should('exist')
|
|
57
|
-
.contains('Text body copy description');
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('has view code button', () => {
|
|
61
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('shows code on click', () => {
|
|
65
|
-
cy.get('@viewCodeBtn').click();
|
|
66
|
-
cy.get('@container')
|
|
67
|
-
.find('textarea')
|
|
68
|
-
.should('exist');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('closes code on click', () => {
|
|
72
|
-
cy.get('@viewCodeBtn').click();
|
|
73
|
-
});
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
describe('Box example 3 section', () => {
|
|
77
|
-
beforeEach(() => {
|
|
78
|
-
cy.get('[data-testid="Box-example-3"]')
|
|
79
|
-
.as('container')
|
|
80
|
-
.find('[data-preview="Box"]')
|
|
81
|
-
.as('preview');
|
|
82
|
-
|
|
83
|
-
cy.get('@container')
|
|
84
|
-
.find('button')
|
|
85
|
-
.contains('View Code')
|
|
86
|
-
.as('viewCodeBtn');
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
it('renders box preview', () => {
|
|
90
|
-
cy.get('@container')
|
|
91
|
-
.should('exist');
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
it('has view code button', () => {
|
|
95
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it('shows code on click', () => {
|
|
99
|
-
cy.get('@viewCodeBtn').click();
|
|
100
|
-
cy.get('@container')
|
|
101
|
-
.find('textarea')
|
|
102
|
-
.should('exist');
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
it('closes code on click', () => {
|
|
106
|
-
cy.get('@viewCodeBtn').click();
|
|
107
|
-
cy.get('@container')
|
|
108
|
-
.find('textarea')
|
|
109
|
-
.should('not.exist');
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
});
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
describe('Card component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to card component
|
|
4
|
-
cy.visit('/#card');
|
|
5
|
-
cy.wait(2500)
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
describe('props and methods section', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
cy.get('[data-testid="Card-container"] button[name="rsg-usage"]')
|
|
11
|
-
.contains('Props & methods')
|
|
12
|
-
.as('propsBtn');
|
|
13
|
-
|
|
14
|
-
cy.get('@propsBtn')
|
|
15
|
-
.closest('[class^=rsg--tabs]')
|
|
16
|
-
.as('container');
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
it('is present', () => {
|
|
20
|
-
cy.get('@propsBtn').should('exist');
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('does not show table initially', () => {
|
|
24
|
-
cy.get('@container')
|
|
25
|
-
.find('table')
|
|
26
|
-
.should('not.exist');
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
it('shows the table on button click', () => {
|
|
30
|
-
cy.get('@propsBtn').click();
|
|
31
|
-
cy.get('@container')
|
|
32
|
-
.find('table')
|
|
33
|
-
.should('contain', 'Prop name');
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
describe('Card example 1 section', () => {
|
|
38
|
-
beforeEach(() => {
|
|
39
|
-
cy.get('[data-testid="Card-example-1"]')
|
|
40
|
-
.as('container')
|
|
41
|
-
.find('[data-preview="Card"]')
|
|
42
|
-
.as('preview');
|
|
43
|
-
|
|
44
|
-
cy.get('@container')
|
|
45
|
-
.find('button')
|
|
46
|
-
.contains('View Code')
|
|
47
|
-
.as('viewCodeBtn');
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('renders card preview', () => {
|
|
51
|
-
cy.get('@container')
|
|
52
|
-
.find('h3')
|
|
53
|
-
.should('exist')
|
|
54
|
-
.contains('Title');
|
|
55
|
-
cy.get('@container')
|
|
56
|
-
.find('p')
|
|
57
|
-
.should('exist')
|
|
58
|
-
.contains('Text body copy description');
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('has view code button', () => {
|
|
62
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('shows code on click', () => {
|
|
66
|
-
cy.get('@viewCodeBtn').click();
|
|
67
|
-
cy.get('@container')
|
|
68
|
-
.find('textarea')
|
|
69
|
-
.should('exist');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
it('closes code on click', () => {
|
|
73
|
-
cy.get('@viewCodeBtn').click();
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
describe('Card no body section', () => {
|
|
78
|
-
beforeEach(() => {
|
|
79
|
-
cy.get('[data-testid="Card-example-3"]')
|
|
80
|
-
.as('container')
|
|
81
|
-
.find('[data-preview="Card"]')
|
|
82
|
-
.as('preview');
|
|
83
|
-
|
|
84
|
-
cy.get('@container')
|
|
85
|
-
.find('button')
|
|
86
|
-
.contains('View Code')
|
|
87
|
-
.as('viewCodeBtn');
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
it('renders card no body preview', () => {
|
|
91
|
-
cy.get('@container')
|
|
92
|
-
.should('exist');
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('has view code button', () => {
|
|
96
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('shows code on click', () => {
|
|
100
|
-
cy.get('@viewCodeBtn').click();
|
|
101
|
-
cy.get('@container')
|
|
102
|
-
.find('textarea')
|
|
103
|
-
.should('exist');
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it('closes code on click', () => {
|
|
107
|
-
cy.get('@viewCodeBtn').click();
|
|
108
|
-
cy.get('@container')
|
|
109
|
-
.find('textarea')
|
|
110
|
-
.should('not.exist');
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
});
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
describe('DoubleCopy component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to double copy component
|
|
4
|
-
cy.visit('/#doublecopy');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.get('[data-testid="DoubleCopy-container"] button[name="rsg-usage"]')
|
|
10
|
-
.contains('Props & methods')
|
|
11
|
-
.as('propsBtn');
|
|
12
|
-
|
|
13
|
-
cy.get('@propsBtn')
|
|
14
|
-
.closest('[class^=rsg--tabs]')
|
|
15
|
-
.as('container');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('is present', () => {
|
|
19
|
-
cy.get('@propsBtn').should('exist');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('does not show table initially', () => {
|
|
23
|
-
cy.get('@container')
|
|
24
|
-
.find('table')
|
|
25
|
-
.should('not.exist');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('shows the table on button click', () => {
|
|
29
|
-
cy.get('@propsBtn').click();
|
|
30
|
-
cy.get('@container')
|
|
31
|
-
.find('table')
|
|
32
|
-
.should('contain', 'Prop name');
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe('DoubleCopy section', () => {
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
cy.get('[data-testid="DoubleCopy-example-1"]')
|
|
39
|
-
.as('container')
|
|
40
|
-
.find('[data-preview="DoubleCopy"]')
|
|
41
|
-
.as('preview');
|
|
42
|
-
|
|
43
|
-
cy.get('@container')
|
|
44
|
-
.find('button')
|
|
45
|
-
.contains('View Code')
|
|
46
|
-
.as('viewCodeBtn');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('renders doublecopy preview', () => {
|
|
50
|
-
cy.get('@container')
|
|
51
|
-
.find('h1')
|
|
52
|
-
.should('exist')
|
|
53
|
-
.contains('Left Copy');
|
|
54
|
-
cy.get('@container')
|
|
55
|
-
.find('p')
|
|
56
|
-
.should('exist');
|
|
57
|
-
cy.get('@container')
|
|
58
|
-
.find('div:nth-child(2) > div > h1')
|
|
59
|
-
.should('exist')
|
|
60
|
-
.contains('Right Copy');
|
|
61
|
-
cy.get('@container')
|
|
62
|
-
.find('div:nth-child(2) > div > p')
|
|
63
|
-
.should('exist')
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('has view code button', () => {
|
|
67
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('shows code on click', () => {
|
|
71
|
-
cy.get('@viewCodeBtn').click();
|
|
72
|
-
cy.get('@container')
|
|
73
|
-
.find('textarea')
|
|
74
|
-
.should('exist');
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it('closes code on click', () => {
|
|
78
|
-
cy.get('@viewCodeBtn').click();
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
});
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
describe('Herobanner component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to herobanner component
|
|
4
|
-
cy.visit('/#herobanner');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.get('[data-testid="HeroBanner-container"] button[name="rsg-usage"]')
|
|
10
|
-
.contains('Props & methods')
|
|
11
|
-
.as('propsBtn');
|
|
12
|
-
|
|
13
|
-
cy.get('@propsBtn')
|
|
14
|
-
.closest('[class^=rsg--tabs]')
|
|
15
|
-
.as('container');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('is present', () => {
|
|
19
|
-
cy.get('@propsBtn').should('exist');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('does not show table initially', () => {
|
|
23
|
-
cy.get('@container')
|
|
24
|
-
.find('table')
|
|
25
|
-
.should('not.exist');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('shows the table on button click', () => {
|
|
29
|
-
cy.get('@propsBtn').click();
|
|
30
|
-
cy.get('@container')
|
|
31
|
-
.find('table')
|
|
32
|
-
.should('contain', 'Prop name');
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe('HeroBanner section', () => {
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
cy.get('[data-testid="HeroBanner-example-1"]')
|
|
39
|
-
.as('container')
|
|
40
|
-
.find('[data-preview="HeroBanner"]')
|
|
41
|
-
.as('preview');
|
|
42
|
-
|
|
43
|
-
cy.get('@container')
|
|
44
|
-
.find('button')
|
|
45
|
-
.contains('View Code')
|
|
46
|
-
.as('viewCodeBtn');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('renders HeroBanner preview', () => {
|
|
50
|
-
cy.get('@container')
|
|
51
|
-
.find('h1')
|
|
52
|
-
.should('exist')
|
|
53
|
-
.contains('Change Please')
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('has view code button', () => {
|
|
57
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('shows code on click', () => {
|
|
61
|
-
cy.get('@viewCodeBtn').click();
|
|
62
|
-
cy.get('@container')
|
|
63
|
-
.find('textarea')
|
|
64
|
-
.should('exist');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('closes code on click', () => {
|
|
68
|
-
cy.get('@viewCodeBtn').click();
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
});
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
describe('infobanner component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to infobanner component
|
|
4
|
-
cy.visit('/#infobanner');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.get('[data-testid="InfoBanner-container"] button[name="rsg-usage"]')
|
|
10
|
-
.contains('Props & methods')
|
|
11
|
-
.as('propsBtn');
|
|
12
|
-
|
|
13
|
-
cy.get('@propsBtn')
|
|
14
|
-
.closest('[class^=rsg--tabs]')
|
|
15
|
-
.as('container');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('is present', () => {
|
|
19
|
-
cy.get('@propsBtn').should('exist');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('does not show table initially', () => {
|
|
23
|
-
cy.get('@container')
|
|
24
|
-
.find('table')
|
|
25
|
-
.should('not.exist');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('shows the table on button click', () => {
|
|
29
|
-
cy.get('@propsBtn').click();
|
|
30
|
-
cy.get('@container')
|
|
31
|
-
.find('table')
|
|
32
|
-
.should('contain', 'Prop name');
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe('Infobanner section', () => {
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
cy.get('[data-testid="InfoBanner-example-1"]')
|
|
39
|
-
.as('container')
|
|
40
|
-
.find('[data-preview="InfoBanner"]')
|
|
41
|
-
.as('preview');
|
|
42
|
-
|
|
43
|
-
cy.get('@container')
|
|
44
|
-
.find('button')
|
|
45
|
-
.contains('View Code')
|
|
46
|
-
.as('viewCodeBtn');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('renders Infobanner preview', () => {
|
|
50
|
-
cy.get('@container')
|
|
51
|
-
.find('h3')
|
|
52
|
-
.should('exist')
|
|
53
|
-
.contains('Project Name')
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('has view code button', () => {
|
|
57
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it('shows code on click', () => {
|
|
61
|
-
cy.get('@viewCodeBtn').click();
|
|
62
|
-
cy.get('@container')
|
|
63
|
-
.find('textarea')
|
|
64
|
-
.should('exist');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('closes code on click', () => {
|
|
68
|
-
cy.get('@viewCodeBtn').click();
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
describe('PartnerLink component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to partnerLink component
|
|
4
|
-
cy.visit('/#partnerlink');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.get('[data-testid="PartnerLink-container"] button[name="rsg-usage"]')
|
|
10
|
-
.contains('Props & methods')
|
|
11
|
-
.as('propsBtn');
|
|
12
|
-
|
|
13
|
-
cy.get('@propsBtn')
|
|
14
|
-
.closest('[class^=rsg--tabs]')
|
|
15
|
-
.as('container');
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('is present', () => {
|
|
19
|
-
cy.get('@propsBtn').should('exist');
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
it('does not show table initially', () => {
|
|
23
|
-
cy.get('@container')
|
|
24
|
-
.find('table')
|
|
25
|
-
.should('not.exist');
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('shows the table on button click', () => {
|
|
29
|
-
cy.get('@propsBtn').click();
|
|
30
|
-
cy.get('@container')
|
|
31
|
-
.find('table')
|
|
32
|
-
.should('contain', 'Prop name');
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
describe('Partnerlink section', () => {
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
cy.get('[data-testid="PartnerLink-example-1"]')
|
|
39
|
-
.as('container')
|
|
40
|
-
.find('[data-preview="PartnerLink"]')
|
|
41
|
-
.as('preview');
|
|
42
|
-
|
|
43
|
-
cy.get('@container')
|
|
44
|
-
.find('button')
|
|
45
|
-
.contains('View Code')
|
|
46
|
-
.as('viewCodeBtn');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('renders Partnerlink preview', () => {
|
|
50
|
-
cy.get('@container')
|
|
51
|
-
.find('span')
|
|
52
|
-
.contains('Find out more')
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('has view code button', () => {
|
|
56
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
it('shows code on click', () => {
|
|
60
|
-
cy.get('@viewCodeBtn').click();
|
|
61
|
-
cy.get('@container')
|
|
62
|
-
.find('textarea')
|
|
63
|
-
.should('exist');
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
it('closes code on click', () => {
|
|
67
|
-
cy.get('@viewCodeBtn').click();
|
|
68
|
-
});
|
|
69
|
-
});
|
|
70
|
-
});
|