@comicrelief/component-library 6.1.5 → 6.3.0

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.
Files changed (66) hide show
  1. package/cypress/integration/components/Organisms/Donate.spec.js +247 -247
  2. package/dist/components/Atoms/Picture/Picture.md +6 -9
  3. package/dist/components/Atoms/Picture/Picture.test.js +5 -5
  4. package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.md +6 -8
  5. package/dist/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +3 -3
  6. package/dist/components/Molecules/Box/Box.md +5 -7
  7. package/dist/components/Molecules/Box/Box.test.js +3 -3
  8. package/dist/components/Molecules/Card/Card.md +5 -7
  9. package/dist/components/Molecules/Card/Card.test.js +5 -5
  10. package/dist/components/Molecules/CardDs/CardDs.md +8 -12
  11. package/dist/components/Molecules/CardDs/CardDs.test.js +3 -3
  12. package/dist/components/Molecules/PartnerLink/PartnerLink.md +2 -3
  13. package/dist/components/Molecules/PartnerLink/PartnerLink.test.js +3 -3
  14. package/dist/components/Molecules/Promo/Promo.md +13 -14
  15. package/dist/components/Molecules/Promo/Promo.test.js +5 -5
  16. package/dist/components/Molecules/SearchResult/SearchResult.md +12 -16
  17. package/dist/components/Molecules/SearchResult/SearchResult.test.js +5 -5
  18. package/dist/components/Molecules/SingleMessage/SingleMessage.md +37 -48
  19. package/dist/components/Molecules/SingleMessage/SingleMessage.test.js +15 -15
  20. package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.md +15 -20
  21. package/dist/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -3
  22. package/dist/components/Organisms/Donate/Donate.js +35 -7
  23. package/dist/components/Organisms/Donate/Donate.md +148 -14
  24. package/dist/components/Organisms/Donate/Donate.style.js +61 -45
  25. package/dist/components/Organisms/Donate/Donate.test.js +7 -7
  26. package/dist/components/Organisms/Donate/Form/Form.js +11 -6
  27. package/dist/components/Organisms/Donate/Form/PopUpComponent.js +74 -0
  28. package/dist/components/Organisms/Donate/GivingSelector/GivingSelector.js +6 -6
  29. package/dist/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +355 -399
  30. package/dist/components/Organisms/Donate/assets/close.svg +3 -0
  31. package/dist/components/Organisms/Membership/Membership.md +6 -6
  32. package/dist/components/Organisms/Membership/Membership.test.js +5 -5
  33. package/dist/styleguide/data/data.js +9 -3
  34. package/package.json +2 -1
  35. package/src/components/Atoms/Picture/Picture.md +6 -9
  36. package/src/components/Atoms/Picture/Picture.test.js +4 -5
  37. package/src/components/Molecules/ArticleTeaser/ArticleTeaser.md +6 -8
  38. package/src/components/Molecules/ArticleTeaser/ArticleTeaser.test.js +3 -4
  39. package/src/components/Molecules/Box/Box.md +5 -7
  40. package/src/components/Molecules/Box/Box.test.js +2 -3
  41. package/src/components/Molecules/Card/Card.md +5 -7
  42. package/src/components/Molecules/Card/Card.test.js +3 -4
  43. package/src/components/Molecules/CardDs/CardDs.md +8 -12
  44. package/src/components/Molecules/CardDs/CardDs.test.js +3 -4
  45. package/src/components/Molecules/PartnerLink/PartnerLink.md +2 -3
  46. package/src/components/Molecules/PartnerLink/PartnerLink.test.js +2 -3
  47. package/src/components/Molecules/Promo/Promo.md +13 -14
  48. package/src/components/Molecules/Promo/Promo.test.js +5 -6
  49. package/src/components/Molecules/SearchResult/SearchResult.md +12 -16
  50. package/src/components/Molecules/SearchResult/SearchResult.test.js +5 -5
  51. package/src/components/Molecules/SingleMessage/SingleMessage.md +37 -48
  52. package/src/components/Molecules/SingleMessage/SingleMessage.test.js +15 -16
  53. package/src/components/Molecules/SingleMessageDS/SingleMessageDs.md +15 -20
  54. package/src/components/Molecules/SingleMessageDS/SingleMessageDs.test.js +3 -4
  55. package/src/components/Organisms/Donate/Donate.js +91 -50
  56. package/src/components/Organisms/Donate/Donate.md +148 -14
  57. package/src/components/Organisms/Donate/Donate.style.js +16 -1
  58. package/src/components/Organisms/Donate/Donate.test.js +7 -7
  59. package/src/components/Organisms/Donate/Form/Form.js +16 -8
  60. package/src/components/Organisms/Donate/Form/PopUpComponent.js +63 -0
  61. package/src/components/Organisms/Donate/GivingSelector/GivingSelector.js +6 -6
  62. package/src/components/Organisms/Donate/__snapshots__/Donate.test.js.snap +355 -399
  63. package/src/components/Organisms/Donate/assets/close.svg +3 -0
  64. package/src/components/Organisms/Membership/Membership.md +6 -6
  65. package/src/components/Organisms/Membership/Membership.test.js +9 -14
  66. package/src/styleguide/data/data.js +12 -1
@@ -1,283 +1,283 @@
1
1
  describe('Donate component', () => {
2
- before(() => {
3
- // go to donate component
4
- cy.visit('/#donate');
5
- });
2
+ before(() => {
3
+ // go to donate component
4
+ cy.visit('/#donate');
5
+ });
6
6
 
7
- describe('props and methods section', () => {
8
- beforeEach(() => {
9
- cy.get('[data-testid="Donate-container"] button[name="rsg-usage"]')
10
- .contains('Props & methods')
11
- .as('propsBtn');
7
+ describe('props and methods section', () => {
8
+ beforeEach(() => {
9
+ cy.get('[data-testid="Donate-container"] button[name="rsg-usage"]')
10
+ .contains('Props & methods')
11
+ .as('propsBtn');
12
12
 
13
- cy.get('@propsBtn')
14
- .closest('[class^=rsg--tabs]')
15
- .as('container');
16
- });
13
+ cy.get('@propsBtn')
14
+ .closest('[class^=rsg--tabs]')
15
+ .as('container');
16
+ });
17
17
 
18
- it('is present', () => {
19
- cy.get('@propsBtn').should('exist');
20
- });
18
+ it('is present', () => {
19
+ cy.get('@propsBtn').should('exist');
20
+ });
21
21
 
22
- it('does not show table initially', () => {
23
- cy.get('@container')
24
- .find('table')
25
- .should('not.exist');
26
- });
22
+ it('does not show table initially', () => {
23
+ cy.get('@container')
24
+ .find('table')
25
+ .should('not.exist');
26
+ });
27
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
- });
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');
34
33
  });
34
+ });
35
35
 
36
- describe('Donate Form align right section', () => {
37
- beforeEach(() => {
38
- cy.get('[data-testid="Donate-example-1"]')
39
- .as('container')
40
- .find('[data-preview="Donate"]')
41
- .as('preview');
36
+ describe('Donate Form align right section', () => {
37
+ beforeEach(() => {
38
+ cy.get('[data-testid="Donate-example-1"]')
39
+ .as('container')
40
+ .find('[data-preview="Donate"]')
41
+ .as('preview');
42
42
 
43
- cy.get('@container')
44
- .find('button')
45
- .contains('View Code')
46
- .as('viewCodeBtn');
47
- });
43
+ cy.get('@container')
44
+ .find('button')
45
+ .contains('View Code')
46
+ .as('viewCodeBtn');
47
+ });
48
48
 
49
- it('renders donate form align right preview', () => {
50
- //monthly
51
- cy.get('@container')
52
- .find('label[for="give-once"]')
53
- .contains('Give once');
54
- cy.get('@container')
55
- .find('label[for="give-monthly"]')
56
- .contains('Give monthly')
57
- .click();
58
- cy.get('@container')
59
- .find('#mship-1--moneyBuy-box2')
60
- .should('exist')
61
- .click();
62
- cy.get('@container')
63
- .find('[id="mship-1--MoneyBuy-userInput"]')
64
- .should('have.value','10')
65
- .clear()
66
- .type('15.99')
67
- .clear()
68
- .type(' ');
69
- cy.get('@container')
70
- .find('p:nth-child(5)')
71
- .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places')
72
- cy.get('@container')
73
- .find('[id="mship-1--MoneyBuy-userInput"]')
74
- .type('15.999');
75
- cy.get('@container')
76
- .find('p:nth-child(5)')
77
- .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
78
- cy.get('@container')
79
- .find('form > fieldset > input')
80
- .contains('Donate monthly');
81
- cy.get('@container')
82
- .find('h2')
83
- .should('exist');
84
- });
49
+ it('renders donate form align right preview', () => {
50
+ // monthly
51
+ cy.get('@container')
52
+ .find('label[for="give-once"]')
53
+ .contains('Single');
54
+ cy.get('@container')
55
+ .find('label[for="give-monthly"]')
56
+ .contains('Monthly')
57
+ .click();
58
+ cy.get('@container')
59
+ .find('#mship-1--moneyBuy-box2')
60
+ .should('exist')
61
+ .click();
62
+ cy.get('@container')
63
+ .find('[id="mship-1--MoneyBuy-userInput"]')
64
+ .should('have.value', '10')
65
+ .clear()
66
+ .type('15.99')
67
+ .clear()
68
+ .type(' ');
69
+ cy.get('@container')
70
+ .find('p:nth-child(5)')
71
+ .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
72
+ cy.get('@container')
73
+ .find('[id="mship-1--MoneyBuy-userInput"]')
74
+ .type('15.999');
75
+ cy.get('@container')
76
+ .find('p:nth-child(5)')
77
+ .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
78
+ cy.get('@container')
79
+ .find('form > fieldset > input')
80
+ .contains('Donate monthly');
81
+ cy.get('@container')
82
+ .find('h2')
83
+ .should('exist');
84
+ });
85
85
 
86
- it('has view code button', () => {
87
- cy.get('@viewCodeBtn').should('exist');
88
- });
86
+ it('has view code button', () => {
87
+ cy.get('@viewCodeBtn').should('exist');
88
+ });
89
89
 
90
- it('shows code on click', () => {
91
- cy.get('@viewCodeBtn').click();
92
- cy.get('@container')
93
- .find('textarea')
94
- .should('exist');
95
- });
90
+ it('shows code on click', () => {
91
+ cy.get('@viewCodeBtn').click();
92
+ cy.get('@container')
93
+ .find('textarea')
94
+ .should('exist');
95
+ });
96
96
 
97
- it('closes code on click', () => {
98
- cy.get('@viewCodeBtn').click();
99
- });
97
+ it('closes code on click', () => {
98
+ cy.get('@viewCodeBtn').click();
100
99
  });
100
+ });
101
101
 
102
- describe('Donate Form align left section', () => {
103
- beforeEach(() => {
104
- cy.get('[data-testid="Donate-example-3"]')
105
- .as('container')
106
- .find('[data-preview="Donate"]')
107
- .as('preview');
102
+ describe('Donate Form align left section', () => {
103
+ beforeEach(() => {
104
+ cy.get('[data-testid="Donate-example-3"]')
105
+ .as('container')
106
+ .find('[data-preview="Donate"]')
107
+ .as('preview');
108
108
 
109
- cy.get('@container')
110
- .find('button')
111
- .contains('View Code')
112
- .as('viewCodeBtn');
113
- });
109
+ cy.get('@container')
110
+ .find('button')
111
+ .contains('View Code')
112
+ .as('viewCodeBtn');
113
+ });
114
114
 
115
- it('renders donate form align left preview', () => {
116
- cy.get('@container')
117
- .find('label[for="give-once"]')
118
- .contains('Give once');
119
- cy.get('@container')
120
- .find('label[for="give-monthly"]')
121
- .contains('Give monthly');
122
- cy.get('@container')
123
- .find('#mship-1--moneyBuy-box2')
124
- .should('exist')
125
- .click();
126
- cy.get('@container')
127
- .find('[id="mship-1--MoneyBuy-userInput"]')
128
- .should('have.value','20')
129
- .clear()
130
- .type(' ');
131
- cy.get('@container')
132
- .find('p:nth-child(5)')
133
- .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places')
134
- cy.get('@container')
135
- .find('[id="mship-1--MoneyBuy-userInput"]')
136
- .type('10.999');
137
- cy.get('@container')
138
- .find('p:nth-child(5)')
139
- .should('contain','Please enter an amount between £1 and £20000 and up to 2 decimal places');
140
- cy.get('@container')
141
- .find('form > fieldset > input')
142
- .contains('Donate once');
143
- cy.get('@container')
144
- .find('h2')
145
- .should('exist');
146
- });
115
+ it('renders donate form align left preview', () => {
116
+ cy.get('@container')
117
+ .find('label[for="give-once"]')
118
+ .contains('Single');
119
+ cy.get('@container')
120
+ .find('label[for="give-monthly"]')
121
+ .contains('Monthly');
122
+ cy.get('@container')
123
+ .find('#mship-1--moneyBuy-box2')
124
+ .should('exist')
125
+ .click();
126
+ cy.get('@container')
127
+ .find('[id="mship-1--MoneyBuy-userInput"]')
128
+ .should('have.value', '20')
129
+ .clear()
130
+ .type(' ');
131
+ cy.get('@container')
132
+ .find('p:nth-child(5)')
133
+ .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
134
+ cy.get('@container')
135
+ .find('[id="mship-1--MoneyBuy-userInput"]')
136
+ .type('10.999');
137
+ cy.get('@container')
138
+ .find('p:nth-child(5)')
139
+ .should('contain', 'Please enter an amount between £1 and £20000 and up to 2 decimal places');
140
+ cy.get('@container')
141
+ .find('form > fieldset > input')
142
+ .contains('Donate now');
143
+ cy.get('@container')
144
+ .find('h2')
145
+ .should('exist');
146
+ });
147
147
 
148
- it('has view code button', () => {
149
- cy.get('@viewCodeBtn').should('exist');
150
- });
148
+ it('has view code button', () => {
149
+ cy.get('@viewCodeBtn').should('exist');
150
+ });
151
151
 
152
- it('shows code on click', () => {
153
- cy.get('@viewCodeBtn').click();
154
- cy.get('@container')
155
- .find('textarea')
156
- .should('exist');
157
- });
152
+ it('shows code on click', () => {
153
+ cy.get('@viewCodeBtn').click();
154
+ cy.get('@container')
155
+ .find('textarea')
156
+ .should('exist');
157
+ });
158
158
 
159
- it('closes code on click', () => {
160
- cy.get('@viewCodeBtn').click();
161
- });
159
+ it('closes code on click', () => {
160
+ cy.get('@viewCodeBtn').click();
162
161
  });
162
+ });
163
163
 
164
- describe('Single Giving section', () => {
165
- beforeEach(() => {
166
- cy.get('[data-testid="Donate-example-5"]')
167
- .as('container')
168
- .find('[data-preview="Donate"]')
169
- .as('preview');
164
+ describe('Single Giving section', () => {
165
+ beforeEach(() => {
166
+ cy.get('[data-testid="Donate-example-5"]')
167
+ .as('container')
168
+ .find('[data-preview="Donate"]')
169
+ .as('preview');
170
170
 
171
- cy.get('@container')
172
- .find('button')
173
- .contains('View Code')
174
- .as('viewCodeBtn');
175
- });
171
+ cy.get('@container')
172
+ .find('button')
173
+ .contains('View Code')
174
+ .as('viewCodeBtn');
175
+ });
176
176
 
177
- it('renders Single Giving preview', () => {
178
- cy.get('@container')
179
- .find('label[for="give-once"]')
180
- .should('not.exist');
181
- cy.get('@container')
182
- .find('#mship-1--moneyBuy-box3')
183
- .should('exist')
184
- .click();
185
- cy.get('@container')
186
- .find('[id="mship-1--MoneyBuy-userInput"]')
187
- .should('have.value','30')
188
- .clear()
189
- .type('10.99')
190
- .clear()
191
- .type(' ');
192
- cy.get('@container')
193
- .find('p:nth-child(5)')
194
- .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places')
195
- cy.get('@container')
196
- .find('[id="mship-1--MoneyBuy-userInput"]')
197
- .type('10.999');
198
- cy.get('@container')
199
- .find('p:nth-child(5)')
200
- .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
201
- cy.get('@container')
202
- .find('form > fieldset > input')
203
- .contains('Donate once');
204
- cy.get('@container')
205
- .find('h2')
206
- .should('exist');
207
- });
177
+ it('renders Single Giving preview', () => {
178
+ cy.get('@container')
179
+ .find('label[for="give-once"]')
180
+ .should('not.exist');
181
+ cy.get('@container')
182
+ .find('#mship-1--moneyBuy-box3')
183
+ .should('exist')
184
+ .click();
185
+ cy.get('@container')
186
+ .find('[id="mship-1--MoneyBuy-userInput"]')
187
+ .should('have.value', '30')
188
+ .clear()
189
+ .type('10.99')
190
+ .clear()
191
+ .type(' ');
192
+ cy.get('@container')
193
+ .find('p:nth-child(5)')
194
+ .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
195
+ cy.get('@container')
196
+ .find('[id="mship-1--MoneyBuy-userInput"]')
197
+ .type('10.999');
198
+ cy.get('@container')
199
+ .find('p:nth-child(5)')
200
+ .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
201
+ cy.get('@container')
202
+ .find('form > fieldset > input')
203
+ .contains('Donate now');
204
+ cy.get('@container')
205
+ .find('h2')
206
+ .should('exist');
207
+ });
208
208
 
209
- it('has view code button', () => {
210
- cy.get('@viewCodeBtn').should('exist');
211
- });
209
+ it('has view code button', () => {
210
+ cy.get('@viewCodeBtn').should('exist');
211
+ });
212
212
 
213
- it('shows code on click', () => {
214
- cy.get('@viewCodeBtn').click();
215
- cy.get('@container')
216
- .find('textarea')
217
- .should('exist');
218
- });
213
+ it('shows code on click', () => {
214
+ cy.get('@viewCodeBtn').click();
215
+ cy.get('@container')
216
+ .find('textarea')
217
+ .should('exist');
218
+ });
219
219
 
220
- it('closes code on click', () => {
221
- cy.get('@viewCodeBtn').click();
222
- });
220
+ it('closes code on click', () => {
221
+ cy.get('@viewCodeBtn').click();
223
222
  });
223
+ });
224
224
 
225
- describe('Single Giving "No Money Buys" section', () => {
226
- beforeEach(() => {
227
- cy.get('[data-testid="Donate-example-7"]')
228
- .as('container')
229
- .find('[data-preview="Donate"]')
230
- .as('preview');
225
+ describe('Single Giving "No Money Buys" section', () => {
226
+ beforeEach(() => {
227
+ cy.get('[data-testid="Donate-example-7"]')
228
+ .as('container')
229
+ .find('[data-preview="Donate"]')
230
+ .as('preview');
231
231
 
232
- cy.get('@container')
233
- .find('button')
234
- .contains('View Code')
235
- .as('viewCodeBtn');
236
- });
232
+ cy.get('@container')
233
+ .find('button')
234
+ .contains('View Code')
235
+ .as('viewCodeBtn');
236
+ });
237
237
 
238
- it('renders Single Giving "No Money Buys" preview', () => {
239
- cy.get('@container')
240
- .find('label[for="give-once"]')
241
- .should('not.exist');
242
- cy.get('@container')
243
- .find('#mship-1--moneyBuy-box1')
244
- .should('not.exist');
245
- cy.get('@container')
246
- .find('[id="mship-1--MoneyBuy-userInput"]')
247
- .should('exist')
248
- .clear()
249
- .type('5')
250
- .clear();
251
- cy.get('@container')
252
- .find('p:nth-child(4)')
253
- .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places')
254
- cy.get('@container')
255
- .find('[id="mship-1--MoneyBuy-userInput"]')
256
- .type('10.999')
257
- .clear()
258
- .type('5')
259
- .should('not.have','Please enter an amount between £1 and £20000 and up to 2 decimal places');
260
- cy.get('@container')
261
- .find('form > fieldset > input')
262
- .contains('Donate');
263
- cy.get('@container')
264
- .find('h2')
265
- .should('exist');
266
- });
238
+ it('renders Single Giving "No Money Buys" preview', () => {
239
+ cy.get('@container')
240
+ .find('label[for="give-once"]')
241
+ .should('not.exist');
242
+ cy.get('@container')
243
+ .find('#mship-1--moneyBuy-box1')
244
+ .should('not.exist');
245
+ cy.get('@container')
246
+ .find('[id="mship-1--MoneyBuy-userInput"]')
247
+ .should('exist')
248
+ .clear()
249
+ .type('5')
250
+ .clear();
251
+ cy.get('@container')
252
+ .find('p:nth-child(4)')
253
+ .contains('Please enter an amount between £1 and £20000 and up to 2 decimal places');
254
+ cy.get('@container')
255
+ .find('[id="mship-1--MoneyBuy-userInput"]')
256
+ .type('10.999')
257
+ .clear()
258
+ .type('5')
259
+ .should('not.have', 'Please enter an amount between £1 and £20000 and up to 2 decimal places');
260
+ cy.get('@container')
261
+ .find('form > fieldset > input')
262
+ .contains('Donate');
263
+ cy.get('@container')
264
+ .find('h2')
265
+ .should('exist');
266
+ });
267
267
 
268
- it('has view code button', () => {
269
- cy.get('@viewCodeBtn').should('exist');
270
- });
268
+ it('has view code button', () => {
269
+ cy.get('@viewCodeBtn').should('exist');
270
+ });
271
271
 
272
- it('shows code on click', () => {
273
- cy.get('@viewCodeBtn').click();
274
- cy.get('@container')
275
- .find('textarea')
276
- .should('exist');
277
- });
272
+ it('shows code on click', () => {
273
+ cy.get('@viewCodeBtn').click();
274
+ cy.get('@container')
275
+ .find('textarea')
276
+ .should('exist');
277
+ });
278
278
 
279
- it('closes code on click', () => {
280
- cy.get('@viewCodeBtn').click();
281
- });
279
+ it('closes code on click', () => {
280
+ cy.get('@viewCodeBtn').click();
282
281
  });
282
+ });
283
283
  });
@@ -3,19 +3,17 @@ Picture has depenciy of <a href="https://github.com/aFarkas/lazysizes#readme" st
3
3
  Picture
4
4
 
5
5
  ```js
6
- const data = require('../../../styleguide/data/data').default;
7
-
8
- <Picture alt="test Image" imageLow={data.imageLow} images={data.images} />;
6
+ const defaultData = require('../../../styleguide/data/data').defaultData;
7
+ <Picture alt="test Image" imageLow={defaultData.imageLow} images={defaultData.images} />;
9
8
  ```
10
9
 
11
10
  Custom Size.
12
11
 
13
12
  ```js
14
- const data = require('../../../styleguide/data/data').default;
15
- <Picture
13
+ const defaultData = require('../../../styleguide/data/data').defaultData;<Picture
16
14
  alt="test Image"
17
- imageLow={data.imageLow}
18
- images={data.images}
15
+ imageLow={defaultData.imageLow}
16
+ images={defaultData.images}
19
17
  objectFit="cover"
20
18
  width="300px"
21
19
  height="200px"
@@ -25,6 +23,5 @@ const data = require('../../../styleguide/data/data').default;
25
23
  Single image
26
24
 
27
25
  ```js
28
- const data = require('../../../styleguide/data/data').default;
29
- <Picture alt="test Image" image={data.image} objectFit="cover" />;
26
+ const defaultData = require('../../../styleguide/data/data').defaultData;<Picture alt="test Image" image={defaultData.image} objectFit="cover" />;
30
27
  ```
@@ -10,20 +10,20 @@ var _shallowWithTheme = _interopRequireDefault(require("../../../hoc/shallowWith
10
10
 
11
11
  var _Picture = _interopRequireDefault(require("./Picture"));
12
12
 
13
- var _data = _interopRequireDefault(require("../../../styleguide/data/data"));
13
+ var _data = require("../../../styleguide/data/data");
14
14
 
15
15
  it('renders correctly', function () {
16
16
  var tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Picture.default, {
17
- images: _data.default.images,
18
- image: _data.default.image,
17
+ images: _data.defaultData.images,
18
+ image: _data.defaultData.image,
19
19
  alt: "Test images"
20
20
  })).toJSON();
21
21
  expect(tree).toMatchInlineSnapshot("\n .c0 {\n display: block;\n width: 100%;\n height: auto;\n position: relative;\n }\n\n .c1 {\n width: 100%;\n height: auto;\n display: block;\n object-fit: none;\n }\n\n <div\n className=\"c0 lazyload\"\n height=\"auto\"\n width=\"100%\"\n >\n <img\n alt=\"Test images\"\n className=\"c1 lazyload\"\n data-lowsrc={null}\n data-sizes=\"auto\"\n data-src=\"http://images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg\"\n data-srcset=\"//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=200&h=150&q=50 200w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=400&h=300&q=50 400w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=800&h=600&q=50 800w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=1200&h=900&q=50 1200w,//images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg?w=1440&h=1080&q=50 1440w\"\n height=\"auto\"\n src=\"http://images.ctfassets.net/zsfivwzfgl3t/Yq59XdwwQgjNOxky93K1Q/17c2d80dce99067b0b3508f33075cbe3/funding_4-3_2x.jpg\"\n srcSet=\"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7\"\n width=\"100%\"\n />\n </div>\n ");
22
22
  });
23
23
  it('renders correctly with custom props', function () {
24
24
  var tree = (0, _shallowWithTheme.default)( /*#__PURE__*/_react.default.createElement(_Picture.default, {
25
- images: _data.default.images,
26
- image: _data.default.image,
25
+ images: _data.defaultData.images,
26
+ image: _data.defaultData.image,
27
27
  objectFit: "cover",
28
28
  width: "200px",
29
29
  height: "100px",
@@ -1,13 +1,12 @@
1
1
  ### Article teaser
2
2
 
3
3
  ```js
4
- const data = require('../../../styleguide/data/data').default;
5
- <div style={{ display: 'flex', background: '#E1E2E3' }}>
4
+ const defaultData = require('../../../styleguide/data/data').defaultData;<div style={{ display: 'flex', background: '#E1E2E3' }}>
6
5
  <div style={{ margin: '1rem', width: '300px' }}>
7
6
  <ArticleTeaser
8
7
  href="/test"
9
- images={data.images}
10
- imageLow={data.imageLow}
8
+ images={defaultData.images}
9
+ imageLow={defaultData.imageLow}
11
10
  date=" 01 July 2019"
12
11
  title="News article"
13
12
  alt="Image's description"
@@ -17,8 +16,8 @@ const data = require('../../../styleguide/data/data').default;
17
16
  <div style={{ margin: '1rem', width: '300px' }}>
18
17
  <ArticleTeaser
19
18
  href="/test"
20
- images={data.images}
21
- imageLow={data.imageLow}
19
+ images={defaultData.images}
20
+ imageLow={defaultData.imageLow}
22
21
  date=" 01 July 2019"
23
22
  title="News article News article"
24
23
  alt="Image's description"
@@ -31,8 +30,7 @@ const data = require('../../../styleguide/data/data').default;
31
30
  ### Article teaser: Press release
32
31
 
33
32
  ```js
34
- const data = require('../../../styleguide/data/data').default;
35
- <ArticleTeaser
33
+ const defaultData = require('../../../styleguide/data/data').defaultData;<ArticleTeaser
36
34
  href="/test"
37
35
  category=""
38
36
  date=" 01 July 2019"