lighthouse 9.5.0-dev.20221004 → 9.5.0-dev.20221006
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/core/audits/accessibility/aria-meter-name.js +2 -2
- package/core/audits/accessibility/aria-tooltip-name.js +2 -2
- package/core/lib/i18n/README.md +22 -5
- package/dist/report/flow.js +23 -28
- package/flow-report/src/i18n/i18n.tsx +1 -1
- package/flow-report/test/flow-report-pptr-test.ts +16 -0
- package/package.json +1 -1
- package/report/generator/report-generator.js +4 -1
- package/shared/localization/locales/en-US.json +2 -2
- package/shared/localization/locales/en-XL.json +2 -2
- package/tsconfig.json +0 -1
|
@@ -11,7 +11,7 @@ import {formatMessage} from '../../../shared/localization/format';
|
|
|
11
11
|
import {I18n} from '../../../report/renderer/i18n';
|
|
12
12
|
import {UIStrings} from './ui-strings';
|
|
13
13
|
import {useFlowResult} from '../util';
|
|
14
|
-
import strings from './localized-strings';
|
|
14
|
+
import strings from './localized-strings.js';
|
|
15
15
|
import {Util} from '../../../report/renderer/util';
|
|
16
16
|
|
|
17
17
|
const I18nContext = createContext(new I18n('en-US', {...Util.UIStrings, ...UIStrings}));
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import puppeteer, {Browser, Page} from 'puppeteer';
|
|
8
8
|
|
|
9
9
|
import {ReportGenerator} from '../../report/generator/report-generator.js';
|
|
10
|
+
import {swapFlowLocale} from '../../shared/localization/swap-flow-locale.js';
|
|
10
11
|
import {flowResult} from './sample-flow';
|
|
11
12
|
|
|
12
13
|
describe('Lighthouse Flow Report', () => {
|
|
@@ -40,4 +41,19 @@ describe('Lighthouse Flow Report', () => {
|
|
|
40
41
|
expect(pageErrors).toHaveLength(0);
|
|
41
42
|
});
|
|
42
43
|
});
|
|
44
|
+
|
|
45
|
+
describe('Renders the flow report (i18n)', () => {
|
|
46
|
+
before(async () => {
|
|
47
|
+
const html = ReportGenerator.generateFlowReportHtml(swapFlowLocale(flowResult, 'es'));
|
|
48
|
+
await page.setContent(html);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('should load with no errors', async () => {
|
|
52
|
+
expect(pageErrors).toHaveLength(0);
|
|
53
|
+
const el = await page.$('.SummarySectionHeader__content');
|
|
54
|
+
if (!el) throw new Error();
|
|
55
|
+
const text = await el.evaluate(el => el.textContent);
|
|
56
|
+
expect(text).toEqual('Todos los informes');
|
|
57
|
+
});
|
|
58
|
+
});
|
|
43
59
|
}).timeout(35_000);
|
package/package.json
CHANGED
|
@@ -65,10 +65,13 @@ class ReportGenerator {
|
|
|
65
65
|
*/
|
|
66
66
|
static generateFlowReportHtml(flow) {
|
|
67
67
|
const sanitizedJson = ReportGenerator.sanitizeJson(flow);
|
|
68
|
+
// terser does its own sanitization, but keep this basic replace for when
|
|
69
|
+
// we want to generate a report without minification.
|
|
70
|
+
const sanitizedJavascript = reportAssets.FLOW_REPORT_JAVASCRIPT.replace(/<\//g, '\\u003c/');
|
|
68
71
|
return ReportGenerator.replaceStrings(reportAssets.FLOW_REPORT_TEMPLATE, [
|
|
69
72
|
/* eslint-disable max-len */
|
|
70
73
|
{search: '%%LIGHTHOUSE_FLOW_JSON%%', replacement: sanitizedJson},
|
|
71
|
-
{search: '%%LIGHTHOUSE_FLOW_JAVASCRIPT%%', replacement:
|
|
74
|
+
{search: '%%LIGHTHOUSE_FLOW_JAVASCRIPT%%', replacement: sanitizedJavascript},
|
|
72
75
|
{search: '/*%%LIGHTHOUSE_FLOW_CSS%%*/', replacement: reportAssets.FLOW_REPORT_CSS},
|
|
73
76
|
/* eslint-enable max-len */
|
|
74
77
|
]);
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"message": "ARIA input fields have accessible names"
|
|
55
55
|
},
|
|
56
56
|
"core/audits/accessibility/aria-meter-name.js | description": {
|
|
57
|
-
"message": "When
|
|
57
|
+
"message": "When a meter element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn how to name `meter` elements](https://dequeuniversity.com/rules/axe/4.4/aria-meter-name)."
|
|
58
58
|
},
|
|
59
59
|
"core/audits/accessibility/aria-meter-name.js | failureTitle": {
|
|
60
60
|
"message": "ARIA `meter` elements do not have accessible names."
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"message": "ARIA toggle fields have accessible names"
|
|
118
118
|
},
|
|
119
119
|
"core/audits/accessibility/aria-tooltip-name.js | description": {
|
|
120
|
-
"message": "When
|
|
120
|
+
"message": "When a tooltip element doesn't have an accessible name, screen readers announce it with a generic name, making it unusable for users who rely on screen readers. [Learn how to name `tooltip` elements](https://dequeuniversity.com/rules/axe/4.4/aria-tooltip-name)."
|
|
121
121
|
},
|
|
122
122
|
"core/audits/accessibility/aria-tooltip-name.js | failureTitle": {
|
|
123
123
|
"message": "ARIA `tooltip` elements do not have accessible names."
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"message": "ÂŔÎÁ îńp̂út̂ f́îél̂d́ŝ h́âv́ê áĉćêśŝíb̂ĺê ńâḿêś"
|
|
55
55
|
},
|
|
56
56
|
"core/audits/accessibility/aria-meter-name.js | description": {
|
|
57
|
-
"message": "Ŵh́êń â
|
|
57
|
+
"message": "Ŵh́êń â ḿêt́êŕ êĺêḿêńt̂ d́ôéŝń't̂ h́âv́ê án̂ áĉćêśŝíb̂ĺê ńâḿê, śĉŕêén̂ ŕêád̂ér̂ś âńn̂óûńĉé ît́ ŵít̂h́ â ǵêńêŕîć n̂ám̂é, m̂ák̂ín̂ǵ ît́ ûńûśâb́l̂é f̂ór̂ úŝér̂ś ŵh́ô ŕêĺŷ ón̂ śĉŕêén̂ ŕêád̂ér̂ś. [L̂éâŕn̂ h́ôẃ t̂ó n̂ám̂é `meter` êĺêḿêńt̂ś](https://dequeuniversity.com/rules/axe/4.4/aria-meter-name)."
|
|
58
58
|
},
|
|
59
59
|
"core/audits/accessibility/aria-meter-name.js | failureTitle": {
|
|
60
60
|
"message": "ÂŔÎÁ `meter` êĺêḿêńt̂ś d̂ó n̂ót̂ h́âv́ê áĉćêśŝíb̂ĺê ńâḿêś."
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"message": "ÂŔÎÁ t̂óĝǵl̂é f̂íêĺd̂ś ĥáv̂é âćĉéŝśîb́l̂é n̂ám̂éŝ"
|
|
118
118
|
},
|
|
119
119
|
"core/audits/accessibility/aria-tooltip-name.js | description": {
|
|
120
|
-
"message": "Ŵh́êń â
|
|
120
|
+
"message": "Ŵh́êń â t́ôól̂t́îṕ êĺêḿêńt̂ d́ôéŝń't̂ h́âv́ê án̂ áĉćêśŝíb̂ĺê ńâḿê, śĉŕêén̂ ŕêád̂ér̂ś âńn̂óûńĉé ît́ ŵít̂h́ â ǵêńêŕîć n̂ám̂é, m̂ák̂ín̂ǵ ît́ ûńûśâb́l̂é f̂ór̂ úŝér̂ś ŵh́ô ŕêĺŷ ón̂ śĉŕêén̂ ŕêád̂ér̂ś. [L̂éâŕn̂ h́ôẃ t̂ó n̂ám̂é `tooltip` êĺêḿêńt̂ś](https://dequeuniversity.com/rules/axe/4.4/aria-tooltip-name)."
|
|
121
121
|
},
|
|
122
122
|
"core/audits/accessibility/aria-tooltip-name.js | failureTitle": {
|
|
123
123
|
"message": "ÂŔÎÁ `tooltip` êĺêḿêńt̂ś d̂ó n̂ót̂ h́âv́ê áĉćêśŝíb̂ĺê ńâḿêś."
|
package/tsconfig.json
CHANGED
|
@@ -102,7 +102,6 @@
|
|
|
102
102
|
"core/test/runner-test.js",
|
|
103
103
|
"core/test/scoring-test.js",
|
|
104
104
|
"core/test/scripts/i18n/bake-ctc-to-lhl-test.js",
|
|
105
|
-
"core/test/scripts/i18n/collect-strings-test.js",
|
|
106
105
|
],
|
|
107
106
|
"files": [
|
|
108
107
|
// Opt-in to typechecking for some core tests and test-support files.
|