diff --git a/.config/.lintstagedrc.js b/.config/.lintstagedrc.js index 3a6fa02b1ec..1ac4f639edd 100644 --- a/.config/.lintstagedrc.js +++ b/.config/.lintstagedrc.js @@ -1,5 +1,5 @@ export default { '*.md': 'markdownlint -c .config/.markdown-lint.yml', '*.{css,scss}': 'stylelint --fix --allow-empty-input', - '*.{js,ts,tsx,jsx,mjs,cjs}': ['xo --fix'] + '*.{js,ts,tsx,jsx,mjs,cjs}': 'xo --fix' }; diff --git a/package-lock.json b/package-lock.json index 62a5f091c64..7d910986d5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,7 +54,7 @@ "tslib": "^2.6.3", "tsx": "^4.16.2", "typescript": "^5.4.5", - "validate-branch-name": "^1.3.0", + "validate-branch-name": "^1.3.1", "xo": "^0.59.2" } }, @@ -35631,13 +35631,13 @@ } }, "node_modules/validate-branch-name": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/validate-branch-name/-/validate-branch-name-1.3.0.tgz", - "integrity": "sha512-8U+soXh1scJpd8iuGn7DC9QY15PU529EyEBDKjIBhV65uFyS/sT8lCtnNq0DmxIS3VKQpgvdWf96FuM9ENX2uw==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/validate-branch-name/-/validate-branch-name-1.3.1.tgz", + "integrity": "sha512-DmNdzRIM6nhnXWdBF8Yq8aIJF1MvVt+VVd6MwDkLdIhIZ/yhxJlUcp+EwOB4Nttd4HNl53ixozKbaf5knEKXIA==", "dev": true, "dependencies": { "commander": "^8.3.0", - "cosmiconfig": "^7.0.1", + "cosmiconfig": "^8.1.3", "current-git-branch": "^1.1.0" }, "bin": { @@ -35654,19 +35654,29 @@ } }, "node_modules/validate-branch-name/node_modules/cosmiconfig": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz", - "integrity": "sha512-AdmX6xUzdNASswsFtmwSt7Vj8po9IuqXm0UXz7QKPuEUmPB4XyjGfaAr2PSuELMwkRMVH1EpIkX5bTZGRB3eCA==", + "version": "8.3.6", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.3.6.tgz", + "integrity": "sha512-kcZ6+W5QzcJ3P1Mt+83OUv/oHFqZHIx8DuxG6eZ5RGMERoLqp4BuGjhHLYGK+Kf5XVkQvqBSmAy/nGWN3qDgEA==", "dev": true, "dependencies": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0", + "path-type": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, "node_modules/validate-branch-name/node_modules/path-type": { @@ -35678,15 +35688,6 @@ "node": ">=8" } }, - "node_modules/validate-branch-name/node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "dev": true, - "engines": { - "node": ">= 6" - } - }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", diff --git a/package.json b/package.json index e03f05cb841..e971bb822bd 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "tslib": "^2.6.3", "tsx": "^4.16.2", "typescript": "^5.4.5", - "validate-branch-name": "^1.3.0", + "validate-branch-name": "^1.3.1", "xo": "^0.59.2" }, "validate-branch-name": { diff --git a/showcases/screen-reader/__snapshots__/windows/chromium/DBDrawer-should-autofocus.txt b/showcases/screen-reader/__snapshots__/windows/chromium/DBDrawer-should-autofocus.txt index d8b26321ea1..36f2b938c2e 100644 --- a/showcases/screen-reader/__snapshots__/windows/chromium/DBDrawer-should-autofocus.txt +++ b/showcases/screen-reader/__snapshots__/windows/chromium/DBDrawer-should-autofocus.txt @@ -1 +1 @@ -["unknown. dialog. document. clickable, Close Button, button. dialog. button, Close Button","Functional"] \ No newline at end of file +["button. dialog. document. clickable, Close Button, button. dialog. button, Close Button","Functional"] \ No newline at end of file diff --git a/showcases/screen-reader/default.ts b/showcases/screen-reader/default.ts index e79ce4cf433..f2d2fc911c8 100644 --- a/showcases/screen-reader/default.ts +++ b/showcases/screen-reader/default.ts @@ -49,7 +49,8 @@ const cleanSpeakInstructions = (phraseLog: string[]): string[] => export const generateSnapshot = async ( screenReader?: VoiceOverPlaywright | NVDAPlaywright, - retry?: number + retry?: number, + phraseLogConvertFn?: (phraseLog: string[]) => string[] ) => { if (!screenReader) return; @@ -61,6 +62,10 @@ export const generateSnapshot = async ( phraseLog = cleanSpeakInstructions(phraseLog); + if (phraseLogConvertFn) { + phraseLog = phraseLogConvertFn(phraseLog); + } + let snapshot = JSON.stringify(phraseLog); for (const [key, values] of Object.entries(translations)) { diff --git a/showcases/screen-reader/tests/drawer.spec.ts b/showcases/screen-reader/tests/drawer.spec.ts index 74fcb92e4b3..28a9f4e39ff 100644 --- a/showcases/screen-reader/tests/drawer.spec.ts +++ b/showcases/screen-reader/tests/drawer.spec.ts @@ -1,4 +1,4 @@ -import { getTest, testDefault } from '../default'; +import { generateSnapshot, getTest, testDefault } from '../default'; const test = getTest(); @@ -11,6 +11,23 @@ test.describe('DBDrawer', () => { const screenReader = voiceOver ?? nvda; await screenReader?.act(); await screenReader?.next(); + }, + async postTestFn(voiceOver, nvda, retry) { + if (nvda) { + /* + * There is a timing issue for windows which results in different outputs in CICD. + * We avoid this by replacing the generated log files + */ + await generateSnapshot(nvda, retry, (phraseLog) => + phraseLog.map((log) => + log + .replace('Showcase, document. unknown', 'button') + .replace('unknown', 'button') + ) + ); + } else if (voiceOver) { + await generateSnapshot(voiceOver, retry); + } } }); });