@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
|
@@ -1,537 +0,0 @@
|
|
|
1
|
-
describe('Single Message component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to single message component
|
|
4
|
-
cy.visit('/#singlemessage');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.get('[data-testid="SingleMessage-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('Single message section', () => {
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
cy.get('[data-testid="SingleMessage-example-1"]')
|
|
39
|
-
.as('container')
|
|
40
|
-
.find('[data-preview="SingleMessage"]')
|
|
41
|
-
.as('preview');
|
|
42
|
-
|
|
43
|
-
cy.get('@container')
|
|
44
|
-
.find('button')
|
|
45
|
-
.contains('View Code')
|
|
46
|
-
.as('viewCodeBtn');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('renders single message preview', () => {
|
|
50
|
-
cy.get('@container')
|
|
51
|
-
.find('img')
|
|
52
|
-
.should('exist');
|
|
53
|
-
cy.get('@container')
|
|
54
|
-
.find('h1')
|
|
55
|
-
.contains('title');
|
|
56
|
-
cy.get('@container')
|
|
57
|
-
.find('p')
|
|
58
|
-
.contains('description');
|
|
59
|
-
cy.get('@container')
|
|
60
|
-
.find('a')
|
|
61
|
-
.contains('CTA');
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('has view code button', () => {
|
|
65
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it('shows code on click', () => {
|
|
69
|
-
cy.get('@viewCodeBtn').click();
|
|
70
|
-
cy.get('@container')
|
|
71
|
-
.find('textarea')
|
|
72
|
-
.should('exist');
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it('closes code on click', () => {
|
|
76
|
-
cy.get('@viewCodeBtn').click();
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
describe('Single Message fullImage section', () => {
|
|
81
|
-
beforeEach(() => {
|
|
82
|
-
cy.get('[data-testid="SingleMessage-example-3"]')
|
|
83
|
-
.as('container')
|
|
84
|
-
.find('[data-preview="SingleMessage"]')
|
|
85
|
-
.as('preview');
|
|
86
|
-
|
|
87
|
-
cy.get('@container')
|
|
88
|
-
.find('button')
|
|
89
|
-
.contains('View Code')
|
|
90
|
-
.as('viewCodeBtn');
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
it('renders single message full image preview', () => {
|
|
94
|
-
cy.get('@container')
|
|
95
|
-
.find('img')
|
|
96
|
-
.should('exist');
|
|
97
|
-
cy.get('@container')
|
|
98
|
-
.find('h1')
|
|
99
|
-
.contains('title');
|
|
100
|
-
cy.get('@container')
|
|
101
|
-
.find('p')
|
|
102
|
-
.contains('description');
|
|
103
|
-
cy.get('@container')
|
|
104
|
-
.find('a')
|
|
105
|
-
.contains('CTA');
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
it('has view code button', () => {
|
|
109
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
it('shows code on click', () => {
|
|
113
|
-
cy.get('@viewCodeBtn').click();
|
|
114
|
-
cy.get('@container')
|
|
115
|
-
.find('textarea')
|
|
116
|
-
.should('exist');
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
it('closes code on click', () => {
|
|
120
|
-
cy.get('@viewCodeBtn').click();
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
describe('Single Message fullImage no copy section', () => {
|
|
125
|
-
beforeEach(() => {
|
|
126
|
-
cy.get('[data-testid="SingleMessage-example-5"]')
|
|
127
|
-
.as('container')
|
|
128
|
-
.find('[data-preview="SingleMessage"]')
|
|
129
|
-
.as('preview');
|
|
130
|
-
|
|
131
|
-
cy.get('@container')
|
|
132
|
-
.find('button')
|
|
133
|
-
.contains('View Code')
|
|
134
|
-
.as('viewCodeBtn');
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it('renders single message full image no copy preview', () => {
|
|
138
|
-
cy.get('@container')
|
|
139
|
-
.find('img')
|
|
140
|
-
.should('exist');
|
|
141
|
-
cy.get('@container')
|
|
142
|
-
.find('h1')
|
|
143
|
-
.should('not.exist');
|
|
144
|
-
cy.get('@container')
|
|
145
|
-
.find('p')
|
|
146
|
-
.should('not.exist');
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it('has view code button', () => {
|
|
150
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
151
|
-
});
|
|
152
|
-
|
|
153
|
-
it('shows code on click', () => {
|
|
154
|
-
cy.get('@viewCodeBtn').click();
|
|
155
|
-
cy.get('@container')
|
|
156
|
-
.find('textarea')
|
|
157
|
-
.should('exist');
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it('closes code on click', () => {
|
|
161
|
-
cy.get('@viewCodeBtn').click();
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
|
|
165
|
-
describe('Single Message fullImage no image section', () => {
|
|
166
|
-
beforeEach(() => {
|
|
167
|
-
cy.get('[data-testid="SingleMessage-example-7"]')
|
|
168
|
-
.as('container')
|
|
169
|
-
.find('[data-preview="SingleMessage"]')
|
|
170
|
-
.as('preview');
|
|
171
|
-
|
|
172
|
-
cy.get('@container')
|
|
173
|
-
.find('button')
|
|
174
|
-
.contains('View Code')
|
|
175
|
-
.as('viewCodeBtn');
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
it('renders single message full image no copy preview', () => {
|
|
179
|
-
cy.get('@container')
|
|
180
|
-
.find('img')
|
|
181
|
-
.should('not.exist');
|
|
182
|
-
cy.get('@container')
|
|
183
|
-
.find('h1')
|
|
184
|
-
.should('not.exist');
|
|
185
|
-
cy.get('@container')
|
|
186
|
-
.find('p')
|
|
187
|
-
.should('exist');
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
it('has view code button', () => {
|
|
191
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
192
|
-
});
|
|
193
|
-
|
|
194
|
-
it('shows code on click', () => {
|
|
195
|
-
cy.get('@viewCodeBtn').click();
|
|
196
|
-
cy.get('@container')
|
|
197
|
-
.find('textarea')
|
|
198
|
-
.should('exist');
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
it('closes code on click', () => {
|
|
202
|
-
cy.get('@viewCodeBtn').click();
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
describe('Single Message vertical height 100% section', () => {
|
|
207
|
-
beforeEach(() => {
|
|
208
|
-
cy.get('[data-testid="SingleMessage-example-9"]')
|
|
209
|
-
.as('container')
|
|
210
|
-
.find('[data-preview="SingleMessage"]')
|
|
211
|
-
.as('preview');
|
|
212
|
-
|
|
213
|
-
cy.get('@container')
|
|
214
|
-
.find('button')
|
|
215
|
-
.contains('View Code')
|
|
216
|
-
.as('viewCodeBtn');
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
it('renders single message vertical height preview', () => {
|
|
220
|
-
cy.get('@container')
|
|
221
|
-
.find('img')
|
|
222
|
-
.should('exist');
|
|
223
|
-
cy.get('@container')
|
|
224
|
-
.find('h1')
|
|
225
|
-
.should('not.exist');
|
|
226
|
-
cy.get('@container')
|
|
227
|
-
.find('p')
|
|
228
|
-
.should('exist');
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
it('has view code button', () => {
|
|
232
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
it('shows code on click', () => {
|
|
236
|
-
cy.get('@viewCodeBtn').click();
|
|
237
|
-
cy.get('@container')
|
|
238
|
-
.find('textarea')
|
|
239
|
-
.should('exist');
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
it('closes code on click', () => {
|
|
243
|
-
cy.get('@viewCodeBtn').click();
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
describe('Single Message double image section', () => {
|
|
248
|
-
beforeEach(() => {
|
|
249
|
-
cy.get('[data-testid="SingleMessage-example-11"]')
|
|
250
|
-
.as('container')
|
|
251
|
-
.find('[data-preview="SingleMessage"]')
|
|
252
|
-
.as('preview');
|
|
253
|
-
|
|
254
|
-
cy.get('@container')
|
|
255
|
-
.find('button')
|
|
256
|
-
.contains('View Code')
|
|
257
|
-
.as('viewCodeBtn');
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
it('renders single message double image preview', () => {
|
|
261
|
-
cy.get('@container')
|
|
262
|
-
.find('div:nth-child(1) > div > img')
|
|
263
|
-
.should('exist');
|
|
264
|
-
cy.get('@container')
|
|
265
|
-
.find('div:nth-child(2) > div > img')
|
|
266
|
-
.should('exist');
|
|
267
|
-
cy.get('@container')
|
|
268
|
-
.find('h1')
|
|
269
|
-
.should('not.exist');
|
|
270
|
-
cy.get('@container')
|
|
271
|
-
.find('p')
|
|
272
|
-
.contains('The creativity that goes into helping people have a better life is extraordinary.')
|
|
273
|
-
.should('exist');
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
it('has view code button', () => {
|
|
277
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
it('shows code on click', () => {
|
|
281
|
-
cy.get('@viewCodeBtn').click();
|
|
282
|
-
cy.get('@container')
|
|
283
|
-
.find('textarea')
|
|
284
|
-
.should('exist');
|
|
285
|
-
});
|
|
286
|
-
|
|
287
|
-
it('closes code on click', () => {
|
|
288
|
-
cy.get('@viewCodeBtn').click();
|
|
289
|
-
});
|
|
290
|
-
});
|
|
291
|
-
|
|
292
|
-
describe('Single Message with 16:9 video section', () => {
|
|
293
|
-
beforeEach(() => {
|
|
294
|
-
cy.get('[data-testid="SingleMessage-example-13"]')
|
|
295
|
-
.as('container')
|
|
296
|
-
.find('[data-preview="SingleMessage"]')
|
|
297
|
-
.as('preview');
|
|
298
|
-
|
|
299
|
-
cy.get('@container')
|
|
300
|
-
.find('button')
|
|
301
|
-
.contains('View Code')
|
|
302
|
-
.as('viewCodeBtn');
|
|
303
|
-
});
|
|
304
|
-
|
|
305
|
-
it('renders single message with 16:9 video preview', () => {
|
|
306
|
-
cy.get('@container')
|
|
307
|
-
.find('button')
|
|
308
|
-
.should('exist')
|
|
309
|
-
.contains('Play video');
|
|
310
|
-
cy.get('@container')
|
|
311
|
-
.find('h1')
|
|
312
|
-
.should('not.exist');
|
|
313
|
-
cy.get('@container')
|
|
314
|
-
.find('p')
|
|
315
|
-
.contains('Single Message with 16:9 video, copy first')
|
|
316
|
-
.should('exist');
|
|
317
|
-
});
|
|
318
|
-
|
|
319
|
-
it('has view code button', () => {
|
|
320
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
321
|
-
});
|
|
322
|
-
|
|
323
|
-
it('shows code on click', () => {
|
|
324
|
-
cy.get('@viewCodeBtn').click();
|
|
325
|
-
cy.get('@container')
|
|
326
|
-
.find('textarea')
|
|
327
|
-
.should('exist');
|
|
328
|
-
});
|
|
329
|
-
|
|
330
|
-
it('closes code on click', () => {
|
|
331
|
-
cy.get('@viewCodeBtn').click();
|
|
332
|
-
});
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
describe('Single Message with 16:9 video left section', () => {
|
|
336
|
-
beforeEach(() => {
|
|
337
|
-
cy.get('[data-testid="SingleMessage-example-14"]')
|
|
338
|
-
.as('container')
|
|
339
|
-
.find('[data-preview="SingleMessage"]')
|
|
340
|
-
.as('preview');
|
|
341
|
-
|
|
342
|
-
cy.get('@container')
|
|
343
|
-
.find('button')
|
|
344
|
-
.contains('View Code')
|
|
345
|
-
.as('viewCodeBtn');
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
it('renders single message with 16:9 video left preview', () => {
|
|
349
|
-
cy.get('@container')
|
|
350
|
-
.find('button')
|
|
351
|
-
.should('exist')
|
|
352
|
-
.contains('Play video');
|
|
353
|
-
cy.get('@container')
|
|
354
|
-
.find('h1')
|
|
355
|
-
.should('not.exist');
|
|
356
|
-
cy.get('@container')
|
|
357
|
-
.find('p')
|
|
358
|
-
.contains('Single Message with 16:9 video')
|
|
359
|
-
.should('exist');
|
|
360
|
-
});
|
|
361
|
-
|
|
362
|
-
it('has view code button', () => {
|
|
363
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
it('shows code on click', () => {
|
|
367
|
-
cy.get('@viewCodeBtn').click();
|
|
368
|
-
cy.get('@container')
|
|
369
|
-
.find('textarea')
|
|
370
|
-
.should('exist');
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
it('closes code on click', () => {
|
|
374
|
-
cy.get('@viewCodeBtn').click();
|
|
375
|
-
});
|
|
376
|
-
});
|
|
377
|
-
|
|
378
|
-
describe('Single Message with portrait video section', () => {
|
|
379
|
-
beforeEach(() => {
|
|
380
|
-
cy.get('[data-testid="SingleMessage-example-16"]')
|
|
381
|
-
.as('container')
|
|
382
|
-
.find('[data-preview="SingleMessage"]')
|
|
383
|
-
.as('preview');
|
|
384
|
-
|
|
385
|
-
cy.get('@container')
|
|
386
|
-
.find('button')
|
|
387
|
-
.contains('View Code')
|
|
388
|
-
.as('viewCodeBtn');
|
|
389
|
-
});
|
|
390
|
-
|
|
391
|
-
it('renders single message with portrait video preview', () => {
|
|
392
|
-
cy.get('@container')
|
|
393
|
-
.find('button')
|
|
394
|
-
.should('exist')
|
|
395
|
-
.contains('Play video');
|
|
396
|
-
cy.get('@container')
|
|
397
|
-
.find('h1')
|
|
398
|
-
.should('not.exist');
|
|
399
|
-
cy.get('@container')
|
|
400
|
-
.find('p')
|
|
401
|
-
.contains('Single Message with portrait video')
|
|
402
|
-
.should('exist');
|
|
403
|
-
});
|
|
404
|
-
|
|
405
|
-
it('has view code button', () => {
|
|
406
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
407
|
-
});
|
|
408
|
-
|
|
409
|
-
it('shows code on click', () => {
|
|
410
|
-
cy.get('@viewCodeBtn').click();
|
|
411
|
-
cy.get('@container')
|
|
412
|
-
.find('textarea')
|
|
413
|
-
.should('exist');
|
|
414
|
-
});
|
|
415
|
-
|
|
416
|
-
it('closes code on click', () => {
|
|
417
|
-
cy.get('@viewCodeBtn').click();
|
|
418
|
-
});
|
|
419
|
-
});
|
|
420
|
-
|
|
421
|
-
describe('Single Message with portrait video, 100VH section', () => {
|
|
422
|
-
beforeEach(() => {
|
|
423
|
-
cy.get('[data-testid="SingleMessage-example-18"]')
|
|
424
|
-
.as('container')
|
|
425
|
-
.find('[data-preview="SingleMessage"]')
|
|
426
|
-
.as('preview');
|
|
427
|
-
|
|
428
|
-
cy.get('@container')
|
|
429
|
-
.find('button')
|
|
430
|
-
.contains('View Code')
|
|
431
|
-
.as('viewCodeBtn');
|
|
432
|
-
});
|
|
433
|
-
|
|
434
|
-
it('renders single message with portrait video, 100VH preview', () => {
|
|
435
|
-
cy.get('@container')
|
|
436
|
-
.find('button')
|
|
437
|
-
.should('exist')
|
|
438
|
-
.contains('Play video');
|
|
439
|
-
cy.get('@container')
|
|
440
|
-
.find('p')
|
|
441
|
-
.contains('Single Message with portrait video, 100VH');
|
|
442
|
-
});
|
|
443
|
-
|
|
444
|
-
it('has view code button', () => {
|
|
445
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
446
|
-
});
|
|
447
|
-
|
|
448
|
-
it('shows code on click', () => {
|
|
449
|
-
cy.get('@viewCodeBtn').click();
|
|
450
|
-
cy.get('@container')
|
|
451
|
-
.find('textarea')
|
|
452
|
-
.should('exist');
|
|
453
|
-
});
|
|
454
|
-
|
|
455
|
-
it('closes code on click', () => {
|
|
456
|
-
cy.get('@viewCodeBtn').click();
|
|
457
|
-
});
|
|
458
|
-
});
|
|
459
|
-
|
|
460
|
-
describe('Single Message with landscape video, 100VH, fullwidth image', () => {
|
|
461
|
-
beforeEach(() => {
|
|
462
|
-
cy.get('[data-testid="SingleMessage-example-20"]')
|
|
463
|
-
.as('container')
|
|
464
|
-
.find('[data-preview="SingleMessage"]')
|
|
465
|
-
.as('preview');
|
|
466
|
-
|
|
467
|
-
cy.get('@container')
|
|
468
|
-
.find('button')
|
|
469
|
-
.contains('View Code')
|
|
470
|
-
.as('viewCodeBtn');
|
|
471
|
-
});
|
|
472
|
-
|
|
473
|
-
it('renders single message with landscape video, 100VH, fullwidth image preview', () => {
|
|
474
|
-
cy.get('@container')
|
|
475
|
-
.find('button')
|
|
476
|
-
.should('exist')
|
|
477
|
-
.contains('Play video');
|
|
478
|
-
cy.get('@container')
|
|
479
|
-
.find('img')
|
|
480
|
-
.should('exist')
|
|
481
|
-
});
|
|
482
|
-
|
|
483
|
-
it('has view code button', () => {
|
|
484
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
485
|
-
});
|
|
486
|
-
|
|
487
|
-
it('shows code on click', () => {
|
|
488
|
-
cy.get('@viewCodeBtn').click();
|
|
489
|
-
cy.get('@container')
|
|
490
|
-
.find('textarea')
|
|
491
|
-
.should('exist');
|
|
492
|
-
});
|
|
493
|
-
|
|
494
|
-
it('closes code on click', () => {
|
|
495
|
-
cy.get('@viewCodeBtn').click();
|
|
496
|
-
});
|
|
497
|
-
});
|
|
498
|
-
|
|
499
|
-
describe('Single Message with landscape video, 50VH, fullwidth image', () => {
|
|
500
|
-
beforeEach(() => {
|
|
501
|
-
cy.get('[data-testid="SingleMessage-example-22"]')
|
|
502
|
-
.as('container')
|
|
503
|
-
.find('[data-preview="SingleMessage"]')
|
|
504
|
-
.as('preview');
|
|
505
|
-
|
|
506
|
-
cy.get('@container')
|
|
507
|
-
.find('button')
|
|
508
|
-
.contains('View Code')
|
|
509
|
-
.as('viewCodeBtn');
|
|
510
|
-
});
|
|
511
|
-
|
|
512
|
-
it('renders single message with landscape video, 50VH, fullwidth image preview', () => {
|
|
513
|
-
cy.get('@container')
|
|
514
|
-
.find('button')
|
|
515
|
-
.should('exist')
|
|
516
|
-
.contains('Play video');
|
|
517
|
-
cy.get('@container')
|
|
518
|
-
.find('img')
|
|
519
|
-
.should('exist')
|
|
520
|
-
});
|
|
521
|
-
|
|
522
|
-
it('has view code button', () => {
|
|
523
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
524
|
-
});
|
|
525
|
-
|
|
526
|
-
it('shows code on click', () => {
|
|
527
|
-
cy.get('@viewCodeBtn').click();
|
|
528
|
-
cy.get('@container')
|
|
529
|
-
.find('textarea')
|
|
530
|
-
.should('exist');
|
|
531
|
-
});
|
|
532
|
-
|
|
533
|
-
it('closes code on click', () => {
|
|
534
|
-
cy.get('@viewCodeBtn').click();
|
|
535
|
-
});
|
|
536
|
-
});
|
|
537
|
-
});
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
describe('Video Banner component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to video banner component
|
|
4
|
-
cy.visit('/#videobanner');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.get('[data-testid="VideoBanner-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('Video Banner section', () => {
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
cy.get('[data-testid="VideoBanner-example-1"]')
|
|
39
|
-
.as('container')
|
|
40
|
-
.find('[data-preview="VideoBanner"]')
|
|
41
|
-
.as('preview');
|
|
42
|
-
|
|
43
|
-
cy.get('@container')
|
|
44
|
-
.find('button')
|
|
45
|
-
.contains('View Code')
|
|
46
|
-
.as('viewCodeBtn');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('renders video banner preview', () => {
|
|
50
|
-
cy.get('@container')
|
|
51
|
-
.find('video')
|
|
52
|
-
.should('exist');
|
|
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
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
describe('Cookie Banner component', () => {
|
|
2
|
-
before(() => {
|
|
3
|
-
// go to cookie banner component
|
|
4
|
-
cy.visit('/#cookiebanner');
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
describe('props and methods section', () => {
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
cy.get('[data-testid="CookieBanner-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('Cookie Banner section', () => {
|
|
37
|
-
beforeEach(() => {
|
|
38
|
-
cy.get('[data-testid="CookieBanner-example-1"]')
|
|
39
|
-
.as('container')
|
|
40
|
-
.find('[data-preview="CookieBanner"]')
|
|
41
|
-
.as('preview');
|
|
42
|
-
|
|
43
|
-
cy.get('@container')
|
|
44
|
-
.find('button')
|
|
45
|
-
.contains('View Code')
|
|
46
|
-
.as('viewCodeBtn');
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('renders cookie banner preview', () => {
|
|
50
|
-
cy.get('@container')
|
|
51
|
-
.find('p')
|
|
52
|
-
.contains('Hello! Comic Relief uses cookies to help make this website better and improve our services. You can learn more about');
|
|
53
|
-
cy.get('@container')
|
|
54
|
-
.find('a')
|
|
55
|
-
.should('have.attr', 'href', 'https://www.comicrelief.com/cookies-policy')
|
|
56
|
-
.contains('our use of cookies');
|
|
57
|
-
cy.get('@container')
|
|
58
|
-
.find('p:nth-child(2) > a:nth-child(1)')
|
|
59
|
-
.contains('Accept')
|
|
60
|
-
.click();
|
|
61
|
-
cy.get('@container')
|
|
62
|
-
.find('p:nth-child(2) > a:nth-child(2)')
|
|
63
|
-
.should('exist')
|
|
64
|
-
.contains('here');
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('has view code button', () => {
|
|
68
|
-
cy.get('@viewCodeBtn').should('exist');
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
it('shows code on click', () => {
|
|
72
|
-
cy.get('@viewCodeBtn').click();
|
|
73
|
-
cy.get('@container')
|
|
74
|
-
.find('textarea')
|
|
75
|
-
.should('exist');
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
it('closes code on click', () => {
|
|
79
|
-
cy.get('@viewCodeBtn').click();
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
});
|