@comicrelief/component-library 7.19.0 → 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/Molecules/VideoBanner/VideoBanner.js +14 -2
- package/dist/components/Molecules/VideoBanner/VideoBanner.md +1 -1
- 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/Molecules/VideoBanner/VideoBanner.js +9 -3
- package/src/components/Molecules/VideoBanner/VideoBanner.md +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
|
@@ -0,0 +1,71 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
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
|
+
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
describe('Promo component', () => {
|
|
2
|
+
before(() => {
|
|
3
|
+
// go to promo component
|
|
4
|
+
cy.visit('/#promo');
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
describe('props and methods section', () => {
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
cy.get('[data-testid="Promo-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('Promo section', () => {
|
|
37
|
+
beforeEach(() => {
|
|
38
|
+
cy.get('[data-testid="Promo-example-1"]')
|
|
39
|
+
.as('container')
|
|
40
|
+
.find('[data-preview="Promo"]')
|
|
41
|
+
.as('preview');
|
|
42
|
+
|
|
43
|
+
cy.get('@container')
|
|
44
|
+
.find('button')
|
|
45
|
+
.contains('View Code')
|
|
46
|
+
.as('viewCodeBtn');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('renders Promo preview', () => {
|
|
50
|
+
cy.get('@container')
|
|
51
|
+
.find('h1')
|
|
52
|
+
.should('exist');
|
|
53
|
+
cy.get('@container')
|
|
54
|
+
.find('p')
|
|
55
|
+
.should('exist');
|
|
56
|
+
cy.get('@container')
|
|
57
|
+
.find('span')
|
|
58
|
+
.should('exist')
|
|
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
|
+
});
|
|
@@ -74,5 +74,11 @@ describe('School Lookup component', () => {
|
|
|
74
74
|
.contains('View Code')
|
|
75
75
|
.as('viewCodeBtn');
|
|
76
76
|
});
|
|
77
|
+
|
|
78
|
+
it('it should show address when school postcode is entered', () => {
|
|
79
|
+
cy.get('@preview')
|
|
80
|
+
.find('input#school-lookup')
|
|
81
|
+
.should('exist');
|
|
82
|
+
});
|
|
77
83
|
});
|
|
78
84
|
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
describe('Search Input component', () => {
|
|
2
|
+
before(() => {
|
|
3
|
+
// go to search input component
|
|
4
|
+
cy.visit('/#searchinput');
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
describe('props and methods section', () => {
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
cy.get('[data-testid="SearchInput-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('Search Input section', () => {
|
|
37
|
+
beforeEach(() => {
|
|
38
|
+
cy.get('[data-testid="SearchInput-example-1"]')
|
|
39
|
+
.as('container')
|
|
40
|
+
.find('[data-preview="SearchInput"]')
|
|
41
|
+
.as('preview');
|
|
42
|
+
|
|
43
|
+
cy.get('@container')
|
|
44
|
+
.find('button')
|
|
45
|
+
.contains('View Code')
|
|
46
|
+
.as('viewCodeBtn');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('renders search input preview', () => {
|
|
50
|
+
cy.get('@container')
|
|
51
|
+
.find('span')
|
|
52
|
+
.should('exist')
|
|
53
|
+
.contains('Search');
|
|
54
|
+
cy.get('@container')
|
|
55
|
+
.find('input')
|
|
56
|
+
.type('test search');
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('has view code button', () => {
|
|
60
|
+
cy.get('@viewCodeBtn').should('exist');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('shows code on click', () => {
|
|
64
|
+
cy.get('@viewCodeBtn').click();
|
|
65
|
+
cy.get('@container')
|
|
66
|
+
.find('textarea')
|
|
67
|
+
.should('exist');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('closes code on click', () => {
|
|
71
|
+
cy.get('@viewCodeBtn').click();
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
});
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
describe('Search Result component', () => {
|
|
2
|
+
before(() => {
|
|
3
|
+
// go to search input component
|
|
4
|
+
cy.visit('/#searchresult');
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
describe('props and methods section', () => {
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
cy.get('[data-testid="SearchResult-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('Search Result Minimalist section', () => {
|
|
37
|
+
beforeEach(() => {
|
|
38
|
+
cy.get('[data-testid="SearchResult-example-1"]')
|
|
39
|
+
.as('container')
|
|
40
|
+
.find('[data-preview="SearchResult"]')
|
|
41
|
+
.as('preview');
|
|
42
|
+
|
|
43
|
+
cy.get('@container')
|
|
44
|
+
.find('button')
|
|
45
|
+
.contains('View Code')
|
|
46
|
+
.as('viewCodeBtn');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('renders minimalist preview', () => {
|
|
50
|
+
cy.get('@container')
|
|
51
|
+
.find('img')
|
|
52
|
+
.should('exist');
|
|
53
|
+
cy.get('@container')
|
|
54
|
+
.find('h3')
|
|
55
|
+
.contains('News article');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('has view code button', () => {
|
|
59
|
+
cy.get('@viewCodeBtn').should('exist');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('shows code on click', () => {
|
|
63
|
+
cy.get('@viewCodeBtn').click();
|
|
64
|
+
cy.get('@container')
|
|
65
|
+
.find('textarea')
|
|
66
|
+
.should('exist');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it('closes code on click', () => {
|
|
70
|
+
cy.get('@viewCodeBtn').click();
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
describe('Search Result with copy section', () => {
|
|
75
|
+
beforeEach(() => {
|
|
76
|
+
cy.get('[data-testid="SearchResult-example-3"]')
|
|
77
|
+
.as('container')
|
|
78
|
+
.find('[data-preview="SearchResult"]')
|
|
79
|
+
.as('preview');
|
|
80
|
+
|
|
81
|
+
cy.get('@container')
|
|
82
|
+
.find('button')
|
|
83
|
+
.contains('View Code')
|
|
84
|
+
.as('viewCodeBtn');
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('renders with copy preview', () => {
|
|
88
|
+
cy.get('@container')
|
|
89
|
+
.find('img')
|
|
90
|
+
.should('exist');
|
|
91
|
+
cy.get('@container')
|
|
92
|
+
.find('h3')
|
|
93
|
+
.contains('News article');
|
|
94
|
+
cy.get('@container')
|
|
95
|
+
.find('p')
|
|
96
|
+
.contains('News article copy');
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('has view code button', () => {
|
|
100
|
+
cy.get('@viewCodeBtn').should('exist');
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
it('shows code on click', () => {
|
|
104
|
+
cy.get('@viewCodeBtn').click();
|
|
105
|
+
cy.get('@container')
|
|
106
|
+
.find('textarea')
|
|
107
|
+
.should('exist');
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
it('closes code on click', () => {
|
|
111
|
+
cy.get('@viewCodeBtn').click();
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
describe('Search Result with date section', () => {
|
|
116
|
+
beforeEach(() => {
|
|
117
|
+
cy.get('[data-testid="SearchResult-example-5"]')
|
|
118
|
+
.as('container')
|
|
119
|
+
.find('[data-preview="SearchResult"]')
|
|
120
|
+
.as('preview');
|
|
121
|
+
|
|
122
|
+
cy.get('@container')
|
|
123
|
+
.find('button')
|
|
124
|
+
.contains('View Code')
|
|
125
|
+
.as('viewCodeBtn');
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('renders with date preview', () => {
|
|
129
|
+
cy.get('@container')
|
|
130
|
+
.find('img')
|
|
131
|
+
.should('exist');
|
|
132
|
+
cy.get('@container')
|
|
133
|
+
.find('span')
|
|
134
|
+
.contains(' 01 July 2019');
|
|
135
|
+
cy.get('@container')
|
|
136
|
+
.find('h3')
|
|
137
|
+
.contains('News article');
|
|
138
|
+
cy.get('@container')
|
|
139
|
+
.find('p')
|
|
140
|
+
.should('not.exist');
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('has view code button', () => {
|
|
144
|
+
cy.get('@viewCodeBtn').should('exist');
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it('shows code on click', () => {
|
|
148
|
+
cy.get('@viewCodeBtn').click();
|
|
149
|
+
cy.get('@container')
|
|
150
|
+
.find('textarea')
|
|
151
|
+
.should('exist');
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('closes code on click', () => {
|
|
155
|
+
cy.get('@viewCodeBtn').click();
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
describe('Search Result with date and type section', () => {
|
|
160
|
+
beforeEach(() => {
|
|
161
|
+
cy.get('[data-testid="SearchResult-example-5"]')
|
|
162
|
+
.as('container')
|
|
163
|
+
.find('[data-preview="SearchResult"]')
|
|
164
|
+
.as('preview');
|
|
165
|
+
|
|
166
|
+
cy.get('@container')
|
|
167
|
+
.find('button')
|
|
168
|
+
.contains('View Code')
|
|
169
|
+
.as('viewCodeBtn');
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('renders with date and type preview', () => {
|
|
173
|
+
cy.get('@container')
|
|
174
|
+
.find('img')
|
|
175
|
+
.should('exist');
|
|
176
|
+
cy.get('@container')
|
|
177
|
+
.find('span')
|
|
178
|
+
.contains(' 01 July 2019');
|
|
179
|
+
cy.get('@container')
|
|
180
|
+
.find('h3')
|
|
181
|
+
.contains('News article');
|
|
182
|
+
cy.get('@container')
|
|
183
|
+
.find('p')
|
|
184
|
+
.should('not.exist');
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
it('has view code button', () => {
|
|
188
|
+
cy.get('@viewCodeBtn').should('exist');
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
it('shows code on click', () => {
|
|
192
|
+
cy.get('@viewCodeBtn').click();
|
|
193
|
+
cy.get('@container')
|
|
194
|
+
.find('textarea')
|
|
195
|
+
.should('exist');
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
it('closes code on click', () => {
|
|
199
|
+
cy.get('@viewCodeBtn').click();
|
|
200
|
+
});
|
|
201
|
+
});
|
|
202
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
describe('Share Button component', () => {
|
|
2
|
+
before(() => {
|
|
3
|
+
// go to share button component
|
|
4
|
+
cy.visit('/#sharebutton');
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
describe('props and methods section', () => {
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
cy.get('[data-testid="ShareButton-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('Share Button section', () => {
|
|
37
|
+
beforeEach(() => {
|
|
38
|
+
cy.get('[data-testid="ShareButton-example-0"]')
|
|
39
|
+
.as('container')
|
|
40
|
+
.find('[data-preview="ShareButton"]')
|
|
41
|
+
.as('preview');
|
|
42
|
+
cy.get('@container')
|
|
43
|
+
.find('button')
|
|
44
|
+
.contains('View Code')
|
|
45
|
+
.as('viewCodeBtn');
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('renders Share Button preview', () => {
|
|
49
|
+
cy.get('@container')
|
|
50
|
+
.find('p')
|
|
51
|
+
.contains('Share with:');
|
|
52
|
+
cy.get('@container')
|
|
53
|
+
.find('ul > li:nth-child(1) > a')
|
|
54
|
+
.should('exist');
|
|
55
|
+
cy.get('@container')
|
|
56
|
+
.find('ul > li:nth-child(2) > a')
|
|
57
|
+
.should('exist');
|
|
58
|
+
cy.get('@container')
|
|
59
|
+
.find('div:nth-child(2) > p')
|
|
60
|
+
.contains('Share some other page:');
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('has view code button', () => {
|
|
64
|
+
cy.get('@viewCodeBtn').should('exist');
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('shows code on click', () => {
|
|
68
|
+
cy.get('@viewCodeBtn').click();
|
|
69
|
+
cy.get('@container')
|
|
70
|
+
.find('textarea')
|
|
71
|
+
.should('exist');
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it('closes code on click', () => {
|
|
75
|
+
cy.get('@viewCodeBtn').click();
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
describe('SimpleSchoolLookup component', () => {
|
|
2
|
+
before(() => {
|
|
3
|
+
// go to simpleschoollookup component
|
|
4
|
+
cy.visit('/#simpleschoollookup');
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
describe('props and methods section', () => {
|
|
8
|
+
beforeEach(() => {
|
|
9
|
+
cy.get('[data-testid="SimpleSchoolLookup-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('view code section', () => {
|
|
37
|
+
beforeEach(() => {
|
|
38
|
+
cy.get('[data-testid="SimpleSchoolLookup-examples"]')
|
|
39
|
+
.as('container');
|
|
40
|
+
|
|
41
|
+
cy.get('@container')
|
|
42
|
+
.find('button')
|
|
43
|
+
.contains('View Code')
|
|
44
|
+
.as('viewCodeBtn');
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it('has view code button', () => {
|
|
48
|
+
cy.get('@viewCodeBtn').should('exist');
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('shows code on click', () => {
|
|
52
|
+
cy.get('@viewCodeBtn').click();
|
|
53
|
+
cy.get('@container')
|
|
54
|
+
.find('textarea')
|
|
55
|
+
.should('exist');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('closes code on click', () => {
|
|
59
|
+
cy.get('@viewCodeBtn').click();
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
describe('Simple School lookup functionality', () => {
|
|
64
|
+
beforeEach(() => {
|
|
65
|
+
cy.get('[data-testid="SimpleSchoolLookup-example-0"]')
|
|
66
|
+
.as('container')
|
|
67
|
+
.find('[data-preview="SimpleSchoolLookup"]')
|
|
68
|
+
.as('preview');
|
|
69
|
+
|
|
70
|
+
cy.get('@container')
|
|
71
|
+
.find('button')
|
|
72
|
+
.contains('View Code')
|
|
73
|
+
.as('viewCodeBtn');
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('it should show address when school postcode is entered', () => {
|
|
77
|
+
cy.get('@container')
|
|
78
|
+
.find('input#school_lookup')
|
|
79
|
+
.type('RG1 4JJ')
|
|
80
|
+
.get('[data-preview="SimpleSchoolLookup"] div > div > button')
|
|
81
|
+
.should('exist');
|
|
82
|
+
});
|
|
83
|
+
});
|
|
84
|
+
});
|