@newskit-render/core 1.2.3 → 1.5.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.
@@ -1,18 +1,9 @@
1
- import React from 'react'
2
1
  import { within } from '@testing-library/react'
3
2
 
4
3
  import Article, { ArticleProps } from '..'
5
4
  import { Slug, URL, Image } from '../../../helpers/global-types'
6
5
  import { renderWithTheme } from '../../../helpers/test-utils'
7
6
 
8
- jest.mock('@newskit-render/shared-components', () => ({
9
- NextLink: (props) => (
10
- <a href={props.href} aria-label={props['aria-label']}>
11
- {props.children}
12
- </a>
13
- ),
14
- }))
15
-
16
7
  const articleData: ArticleProps = {
17
8
  id: 'demo-1',
18
9
  url: 'https://mock-site-url/some-location' as URL,
@@ -145,7 +145,88 @@ exports[`Footer tests should render footer 1`] = `
145
145
  }
146
146
  }
147
147
 
148
- .emotion-17 {
148
+ .emotion-10 {
149
+ display: inline-block;
150
+ transition-property: color;
151
+ transition-duration: 200ms;
152
+ transition-timing-function: cubic-bezier(0, 0, .5, 1);
153
+ color: #FFFFFF;
154
+ -webkit-text-decoration: none;
155
+ text-decoration: none;
156
+ }
157
+
158
+ .emotion-10 svg {
159
+ fill: #FFFFFF;
160
+ }
161
+
162
+ .emotion-10:hover:not(:disabled) {
163
+ color: #FFFFFF;
164
+ -webkit-text-decoration: underline;
165
+ text-decoration: underline;
166
+ }
167
+
168
+ .emotion-10:hover:not(:disabled) svg {
169
+ fill: #FFFFFF;
170
+ }
171
+
172
+ .emotion-10:active:not(:disabled) {
173
+ color: #FFFFFF;
174
+ -webkit-text-decoration: underline;
175
+ text-decoration: underline;
176
+ }
177
+
178
+ .emotion-10:active:not(:disabled) svg {
179
+ fill: #FFFFFF;
180
+ }
181
+
182
+ .emotion-11 {
183
+ display: -webkit-box;
184
+ display: -webkit-flex;
185
+ display: -ms-flexbox;
186
+ display: flex;
187
+ height: 100%;
188
+ -webkit-align-items: center;
189
+ -webkit-box-align: center;
190
+ -ms-flex-align: center;
191
+ align-items: center;
192
+ -webkit-flex-direction: row;
193
+ -ms-flex-direction: row;
194
+ flex-direction: row;
195
+ -webkit-box-pack: start;
196
+ -ms-flex-pack: start;
197
+ -webkit-justify-content: flex-start;
198
+ justify-content: flex-start;
199
+ }
200
+
201
+ .emotion-12 {
202
+ margin: 0;
203
+ padding: 1px 0;
204
+ font-family: "DM Sans",sans-serif;
205
+ font-size: 14px;
206
+ line-height: 1.4285714285714286;
207
+ font-weight: 500;
208
+ letter-spacing: -0.5px;
209
+ display: inline-block;
210
+ display: block;
211
+ }
212
+
213
+ .emotion-12::before {
214
+ content: '';
215
+ display: block;
216
+ height: 0;
217
+ width: 0;
218
+ margin-bottom: -0.3955357142857143em;
219
+ }
220
+
221
+ .emotion-12::after {
222
+ content: '';
223
+ display: block;
224
+ height: 0;
225
+ width: 0;
226
+ margin-top: -0.3955357142857143em;
227
+ }
228
+
229
+ .emotion-35 {
149
230
  margin: 0;
150
231
  color: #535353;
151
232
  font-family: "DM Sans",sans-serif;
@@ -155,7 +236,7 @@ exports[`Footer tests should render footer 1`] = `
155
236
  letter-spacing: -0.5px;
156
237
  }
157
238
 
158
- .emotion-17 svg {
239
+ .emotion-35 svg {
159
240
  fill: #535353;
160
241
  }
161
242
 
@@ -215,9 +296,18 @@ exports[`Footer tests should render footer 1`] = `
215
296
  >
216
297
  <a
217
298
  aria-label="NavLink One"
299
+ class="emotion-10"
218
300
  href="/link-one"
219
301
  >
220
- NavLink One
302
+ <span
303
+ class="emotion-11"
304
+ >
305
+ <span
306
+ class="emotion-12"
307
+ >
308
+ NavLink One
309
+ </span>
310
+ </span>
221
311
  </a>
222
312
  </span>
223
313
  <span
@@ -225,9 +315,18 @@ exports[`Footer tests should render footer 1`] = `
225
315
  >
226
316
  <a
227
317
  aria-label="NavLink Two"
318
+ class="emotion-10"
228
319
  href="/link-two"
229
320
  >
230
- NavLink Two
321
+ <span
322
+ class="emotion-11"
323
+ >
324
+ <span
325
+ class="emotion-12"
326
+ >
327
+ NavLink Two
328
+ </span>
329
+ </span>
231
330
  </a>
232
331
  </span>
233
332
  <span
@@ -235,9 +334,18 @@ exports[`Footer tests should render footer 1`] = `
235
334
  >
236
335
  <a
237
336
  aria-label="NavLink Three"
337
+ class="emotion-10"
238
338
  href="/link-three"
239
339
  >
240
- NavLink Three
340
+ <span
341
+ class="emotion-11"
342
+ >
343
+ <span
344
+ class="emotion-12"
345
+ >
346
+ NavLink Three
347
+ </span>
348
+ </span>
241
349
  </a>
242
350
  </span>
243
351
  <span
@@ -245,9 +353,18 @@ exports[`Footer tests should render footer 1`] = `
245
353
  >
246
354
  <a
247
355
  aria-label="NavLink Four"
356
+ class="emotion-10"
248
357
  href="/link-four"
249
358
  >
250
- NavLink Four
359
+ <span
360
+ class="emotion-11"
361
+ >
362
+ <span
363
+ class="emotion-12"
364
+ >
365
+ NavLink Four
366
+ </span>
367
+ </span>
251
368
  </a>
252
369
  </span>
253
370
  <span
@@ -255,9 +372,18 @@ exports[`Footer tests should render footer 1`] = `
255
372
  >
256
373
  <a
257
374
  aria-label="NavLink Five"
375
+ class="emotion-10"
258
376
  href="/link-five"
259
377
  >
260
- NavLink Five
378
+ <span
379
+ class="emotion-11"
380
+ >
381
+ <span
382
+ class="emotion-12"
383
+ >
384
+ NavLink Five
385
+ </span>
386
+ </span>
261
387
  </a>
262
388
  </span>
263
389
  <span
@@ -265,9 +391,18 @@ exports[`Footer tests should render footer 1`] = `
265
391
  >
266
392
  <a
267
393
  aria-label="NavLink Six"
394
+ class="emotion-10"
268
395
  href="/link-six"
269
396
  >
270
- NavLink Six
397
+ <span
398
+ class="emotion-11"
399
+ >
400
+ <span
401
+ class="emotion-12"
402
+ >
403
+ NavLink Six
404
+ </span>
405
+ </span>
271
406
  </a>
272
407
  </span>
273
408
  </div>
@@ -281,7 +416,7 @@ exports[`Footer tests should render footer 1`] = `
281
416
  />
282
417
  </div>
283
418
  <p
284
- class="emotion-17"
419
+ class="emotion-35"
285
420
  >
286
421
  Copyright © 2020 News Corp. All rights reserved.
287
422
  </p>
@@ -1,15 +1,6 @@
1
- import React from 'react'
2
1
  import { renderWithTheme } from '../../helpers/test-utils'
3
2
  import Footer from '.'
4
3
 
5
- jest.mock('@newskit-render/shared-components', () => ({
6
- NextLink: (props) => (
7
- <a href={props.href} aria-label={props['aria-label']}>
8
- {props.children}
9
- </a>
10
- ),
11
- }))
12
-
13
4
  describe('Footer tests', () => {
14
5
  test('should render footer', () => {
15
6
  const { asFragment } = renderWithTheme(Footer)
@@ -1,4 +1,3 @@
1
- import React from 'react'
2
1
  import { fireEvent } from '@testing-library/react'
3
2
  import { renderWithTheme } from '../../helpers/test-utils'
4
3
  import Header from '.'
@@ -9,14 +8,6 @@ jest.mock('@newskit-render/my-account', () => {
9
8
  }
10
9
  })
11
10
 
12
- jest.mock('@newskit-render/shared-components', () => ({
13
- NextLink: (props) => (
14
- <a href={props.href} aria-label={props['aria-label']}>
15
- {props.children}
16
- </a>
17
- ),
18
- }))
19
-
20
11
  describe('Header tests', () => {
21
12
  test('should open and close mobile menu', () => {
22
13
  const { getByTestId, queryByTestId } = renderWithTheme(Header)
@@ -68,7 +68,7 @@ const pastDueBanner = {
68
68
  },
69
69
  cancelled: {
70
70
  title: 'Your subscription has been cancelled.',
71
- text: 'You will lose access to all benefits on ##DATE##. To re-activate your subscription call 0800 555 1234.',
71
+ text: 'You’ll no longer have access to subscription benefits. To re-activate call 0800 555 1234.',
72
72
  },
73
73
  treshold: {
74
74
  firstNotice: 26,
@@ -4,14 +4,6 @@ import ArticleSlice from '../ArticleSlice'
4
4
  import { getPageMock } from '../../../helpers/mocks'
5
5
  import { SectionContext } from '../SectionContext'
6
6
 
7
- jest.mock('@newskit-render/shared-components', () => ({
8
- NextLink: (props) => (
9
- <a href={props.href} aria-label={props['aria-label']}>
10
- {props.children}
11
- </a>
12
- ),
13
- }))
14
-
15
7
  describe('ArticleSlice', () => {
16
8
  test('Handled LEAD_1_AND_2 article-block', () => {
17
9
  const { getByTestId, getAllByTestId, getAllByRole } = renderWithTheme(
@@ -102,11 +94,11 @@ describe('ArticleSlice', () => {
102
94
  expect(getByText('Layout: LEAD_1_AND_1')).toBeInTheDocument()
103
95
  expect(getByText('test headline').closest('a')).toHaveAttribute(
104
96
  'href',
105
- 'catagory-one/demo-1/test-headline'
97
+ '/catagory-one/demo-1/test-headline'
106
98
  )
107
99
  expect(getByText('test headline 2').closest('a')).toHaveAttribute(
108
100
  'href',
109
- 'catagory-two/demo-2/test-headline-2'
101
+ '/catagory-two/demo-2/test-headline-2'
110
102
  )
111
103
  })
112
104
 
@@ -1,16 +1,7 @@
1
- import React from 'react'
2
1
  import { renderWithTheme } from '../../../../helpers/test-utils'
3
2
  import { SectionRow } from '../SectionRow'
4
3
  import { getPageMock } from '../../../../helpers/mocks'
5
4
 
6
- jest.mock('@newskit-render/shared-components', () => ({
7
- NextLink: (props) => (
8
- <a href={props.href} aria-label={props['aria-label']}>
9
- {props.children}
10
- </a>
11
- ),
12
- }))
13
-
14
5
  describe('SectionRow', () => {
15
6
  test('SectionRow with title', () => {
16
7
  const { asFragment } = renderWithTheme(SectionRow, {