@newskit-render/core 1.76.4 → 1.78.0-alpha.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.
- package/CHANGELOG.md +16 -0
- package/cypress/axe/terminal-log.js +19 -0
- package/cypress/e2e/account/accessibility.spec.js +4 -24
- package/cypress/e2e/help-hub/accessibility.spec.js +21 -0
- package/helpers/fontList.ts +222 -0
- package/package.json +4 -4
- package/pages/_app.tsx +1 -1
- package/pages/_document.tsx +16 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.77.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.77.0-alpha.0...@newskit-render/core@1.77.0) (2022-07-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.76.4](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.76.4-alpha.0...@newskit-render/core@1.76.4) (2022-07-22)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [1.76.3](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.76.3-alpha.0...@newskit-render/core@1.76.3) (2022-07-20)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @newskit-render/core
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const terminalLog = (violations) => {
|
|
2
|
+
cy.task(
|
|
3
|
+
'log',
|
|
4
|
+
`${violations.length} accessibility violation${
|
|
5
|
+
violations.length === 1 ? '' : 's'
|
|
6
|
+
} ${violations.length === 1 ? 'was' : 'were'} detected`
|
|
7
|
+
)
|
|
8
|
+
// pluck specific keys to keep the table readable
|
|
9
|
+
const violationData = violations.map(
|
|
10
|
+
({ id, impact, description, nodes }) => ({
|
|
11
|
+
id,
|
|
12
|
+
impact,
|
|
13
|
+
description,
|
|
14
|
+
nodes: nodes.length,
|
|
15
|
+
})
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
cy.task('table', violationData)
|
|
19
|
+
}
|
|
@@ -1,28 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
cy.task(
|
|
3
|
-
'log',
|
|
4
|
-
`${violations.length} accessibility violation${
|
|
5
|
-
violations.length === 1 ? '' : 's'
|
|
6
|
-
} ${violations.length === 1 ? 'was' : 'were'} detected`
|
|
7
|
-
)
|
|
8
|
-
// pluck specific keys to keep the table readable
|
|
9
|
-
const violationData = violations.map(
|
|
10
|
-
({ id, impact, description, nodes }) => ({
|
|
11
|
-
id,
|
|
12
|
-
impact,
|
|
13
|
-
description,
|
|
14
|
-
nodes: nodes.length,
|
|
15
|
-
})
|
|
16
|
-
)
|
|
17
|
-
|
|
18
|
-
cy.task('table', violationData)
|
|
19
|
-
}
|
|
1
|
+
import { terminalLog } from '../../axe/terminal-log'
|
|
20
2
|
|
|
21
3
|
const pages = [
|
|
22
|
-
{
|
|
23
|
-
url: '/account',
|
|
24
|
-
name: 'Personal Details',
|
|
25
|
-
},
|
|
4
|
+
{ url: '/account', name: 'Personal Details' },
|
|
26
5
|
{ url: '/account/edit/name', name: 'Name form' },
|
|
27
6
|
{ url: '/account/edit/displayName', name: 'Display Name form' },
|
|
28
7
|
{ url: '/account/edit/email', name: 'Email form' },
|
|
@@ -43,7 +22,8 @@ const pages = [
|
|
|
43
22
|
// {
|
|
44
23
|
// url: '/account/payment',
|
|
45
24
|
// name: 'Payment form',
|
|
46
|
-
// skip: { skipFailures: true },
|
|
25
|
+
// skip: { skipFailures: true },
|
|
26
|
+
// error being caused by Stripe, ignore at this time
|
|
47
27
|
// },
|
|
48
28
|
{
|
|
49
29
|
url: '/account/newsletters-and-alerts',
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { terminalLog } from '../../axe/terminal-log'
|
|
2
|
+
|
|
3
|
+
const pages = [
|
|
4
|
+
{ url: '/help-hub', name: 'Landing Page' },
|
|
5
|
+
{ url: '/help-hub/results?q=google', name: 'Search Page' },
|
|
6
|
+
{ url: '/help-hub/article/sign-with-google', name: 'Article Page' },
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
describe('Page accessibility', () => {
|
|
10
|
+
pages.forEach(({ url, name, skip }) => {
|
|
11
|
+
it(`Should pass a11y tests: ${name}`, () => {
|
|
12
|
+
cy.mockConsentAndVisit(url)
|
|
13
|
+
cy.injectAxe()
|
|
14
|
+
cy.checkA11y(null, null, terminalLog, skip)
|
|
15
|
+
|
|
16
|
+
cy.get('[data-testid="autocomplete-input"]').type('Google')
|
|
17
|
+
|
|
18
|
+
cy.checkA11y(null, null, terminalLog, false)
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
})
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
export const fontList = [
|
|
2
|
+
{
|
|
3
|
+
url: '/fonts/dmsans-regular-webfont.woff2',
|
|
4
|
+
format: 'woff2',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
url: '/fonts/dmsans-regular-webfont.woff',
|
|
8
|
+
format: 'woff',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
url: '/fonts/dmsans-italic-webfont.woff2',
|
|
12
|
+
format: 'woff2',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
url: '/fonts/dmsans-italic-webfont.woff',
|
|
16
|
+
format: 'woff',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
url: '/fonts/dmsans-medium-webfont.woff2',
|
|
20
|
+
format: 'woff2',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
url: '/fonts/dmsans-medium-webfont.woff',
|
|
24
|
+
format: 'woff',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
url: '/fonts/dmsans-mediumitalic-webfont.woff2',
|
|
28
|
+
format: 'woff2',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
url: '/fonts/dmsans-mediumitalic-webfont.woff',
|
|
32
|
+
format: 'woff',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
url: '/fonts/dmsans-bold-webfont.woff2',
|
|
36
|
+
format: 'woff2',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
url: '/fonts/dmsans-bold-webfont.woff',
|
|
40
|
+
format: 'woff',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
url: '/fonts/dmsans-bolditalic-webfont.woff2',
|
|
44
|
+
format: 'woff2',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
url: '/fonts/dmsans-bolditalic-webfont.woff',
|
|
48
|
+
format: 'woff',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
url: '/fonts/poppins-bold-webfont.woff2',
|
|
52
|
+
format: 'woff2',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
url: '/fonts/poppins-bold-webfont.woff',
|
|
56
|
+
format: 'woff',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
url: '/fonts/poppins-bolditalic-webfont.woff2',
|
|
60
|
+
format: 'woff2',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
url: '/fonts/poppins-bolditalic-webfont.woff',
|
|
64
|
+
format: 'woff',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
url: '/fonts/poppins-extrabold-webfont.woff2',
|
|
68
|
+
format: 'woff2',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
url: '/fonts/poppins-extrabold-webfont.woff',
|
|
72
|
+
format: 'woff',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
url: '/fonts/poppins-extrabolditalic-webfont.woff2',
|
|
76
|
+
format: 'woff2',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
url: '/fonts/poppins-extrabolditalic-webfont.woff',
|
|
80
|
+
format: 'woff',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
url: '/fonts/poppins-italic-webfont.woff2',
|
|
84
|
+
format: 'woff2',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
url: '/fonts/poppins-italic-webfont.woff',
|
|
88
|
+
format: 'woff',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
url: '/fonts/poppins-light-webfont.woff2',
|
|
92
|
+
format: 'woff2',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
url: '/fonts/poppins-light-webfont.woff',
|
|
96
|
+
format: 'woff',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
url: '/fonts/poppins-lightitalic-webfont.woff2',
|
|
100
|
+
format: 'woff2',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
url: '/fonts/poppins-lightitalic-webfont.woff',
|
|
104
|
+
format: 'woff',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
url: '/fonts/poppins-medium-webfont.woff2',
|
|
108
|
+
format: 'woff2',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
url: '/fonts/poppins-medium-webfont.woff',
|
|
112
|
+
format: 'woff',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
url: '/fonts/poppins-mediumitalic-webfont.woff2',
|
|
116
|
+
format: 'woff2',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
url: '/fonts/poppins-mediumitalic-webfont.woff',
|
|
120
|
+
format: 'woff',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
url: '/fonts/poppins-regular-webfont.woff2',
|
|
124
|
+
format: 'woff2',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
url: '/fonts/poppins-regular-webfont.woff',
|
|
128
|
+
format: 'woff',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
url: '/fonts/poppins-semibold-webfont.woff2',
|
|
132
|
+
format: 'woff2',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
url: '/fonts/poppins-semibold-webfont.woff',
|
|
136
|
+
format: 'woff',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
url: '/fonts/poppins-semibolditalic-webfont.woff2',
|
|
140
|
+
format: 'woff2',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
url: '/fonts/poppins-semibolditalic-webfont.woff',
|
|
144
|
+
format: 'woff',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
url: '/fonts/dmmono-medium.woff2',
|
|
148
|
+
format: 'woff2',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
url: '/fonts/dmmono-medium.woff',
|
|
152
|
+
format: 'woff',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
url: '/fonts/bitter-regular.woff2',
|
|
156
|
+
format: 'woff2',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
url: '/fonts/bitter-regular.woff',
|
|
160
|
+
format: 'woff',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
url: '/fonts/bitter-medium.woff2',
|
|
164
|
+
format: 'woff2',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
url: '/fonts/bitter-medium.woff',
|
|
168
|
+
format: 'woff',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
url: '/fonts/bitter-mediumitalic.woff2',
|
|
172
|
+
format: 'woff2',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
url: '/fonts/bitter-mediumitalic.woff',
|
|
176
|
+
format: 'woff',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
url: '/fonts/bitter-semibold.woff2',
|
|
180
|
+
format: 'woff2',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
url: '/fonts/bitter-semibold.woff',
|
|
184
|
+
format: 'woff',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
url: '/fonts/GillSansMTStd-Medium.otf',
|
|
188
|
+
format: 'otf',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
url: '/fonts/TimesDigital-Bold.ttf',
|
|
192
|
+
format: 'ttf',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
url: '/fonts/TimesDigital-Regular.ttf',
|
|
196
|
+
format: 'ttf',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
url: '/fonts/TimesDigitalW04-Regular.ttf',
|
|
200
|
+
format: 'ttf',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
url: '/fonts/Montserrat-Regular.ttf',
|
|
204
|
+
format: 'ttf',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
url: '/fonts/TheSun-Bold.ttf',
|
|
208
|
+
format: 'ttf',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
url: '/fonts/TheSun-HeavyNarrow.ttf',
|
|
212
|
+
format: 'ttf',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
url: '/fonts/TheSun-Regular.ttf',
|
|
216
|
+
format: 'ttf',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
url: '/fonts/TheSun-Medium.ttf',
|
|
220
|
+
format: 'ttf',
|
|
221
|
+
},
|
|
222
|
+
]
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.78.0-alpha.0",
|
|
4
4
|
"description": "Newskit Render - Core package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"@apollo/client": "3.4.16",
|
|
36
36
|
"@newskit-render/api": "^0.36.0",
|
|
37
37
|
"@newskit-render/auth": "^0.44.0",
|
|
38
|
-
"@newskit-render/checkout": "^0.51.
|
|
38
|
+
"@newskit-render/checkout": "^0.51.3-alpha.0",
|
|
39
39
|
"@newskit-render/feature-flags": "^0.24.0",
|
|
40
40
|
"@newskit-render/feed": "^0.24.0",
|
|
41
|
-
"@newskit-render/my-account": "^0.
|
|
41
|
+
"@newskit-render/my-account": "^0.184.0",
|
|
42
42
|
"@newskit-render/shared-components": "^0.68.0",
|
|
43
|
-
"@newskit-render/standalone-components": "^0.
|
|
43
|
+
"@newskit-render/standalone-components": "^0.31.0-alpha.0",
|
|
44
44
|
"@newskit-render/validation": "^0.50.0",
|
|
45
45
|
"cross-fetch": "3.1.5",
|
|
46
46
|
"graphql": "15.6.0",
|
package/pages/_app.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { AppContext as AppContextType, AppProps } from 'next/app'
|
|
3
3
|
import Head from 'next/head'
|
|
4
|
-
import { ThemeProvider, Global,
|
|
4
|
+
import { ThemeProvider, Global, styled } from 'newskit'
|
|
5
5
|
import { SessionProvider } from '@newskit-render/auth'
|
|
6
6
|
import {
|
|
7
7
|
getFeatureFlags,
|
package/pages/_document.tsx
CHANGED
|
@@ -19,6 +19,21 @@ import {
|
|
|
19
19
|
tealiumProfileId,
|
|
20
20
|
tealiumEnv,
|
|
21
21
|
} from '../config'
|
|
22
|
+
import { fontList } from '../helpers/fontList'
|
|
23
|
+
|
|
24
|
+
const generateFontLink = ({ url, format }: { url: string; format: string }) => {
|
|
25
|
+
const type = `font/${format}`
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<link
|
|
29
|
+
rel="preload"
|
|
30
|
+
href={url}
|
|
31
|
+
as="font"
|
|
32
|
+
type={type}
|
|
33
|
+
crossOrigin="anonymous"
|
|
34
|
+
/>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
22
37
|
|
|
23
38
|
export default class MyDocument extends Document {
|
|
24
39
|
static async getInitialProps(ctx: DocumentContext) {
|
|
@@ -41,6 +56,7 @@ export default class MyDocument extends Document {
|
|
|
41
56
|
return (
|
|
42
57
|
<Html lang="en">
|
|
43
58
|
<Head>
|
|
59
|
+
{fontList.map((font) => generateFontLink(font))}
|
|
44
60
|
<script
|
|
45
61
|
type="text/javascript"
|
|
46
62
|
data-attribute="nr-browser"
|