From 28af343dcc9b925d6f75193ab282906170adb5a0 Mon Sep 17 00:00:00 2001 From: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:53:18 +0200 Subject: [PATCH 1/3] Update .lintstagedrc.js --- .lintstagedrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.lintstagedrc.js b/.lintstagedrc.js index 667e8e750dc..b8e536c21cf 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,5 +1,5 @@ export default { '*.md': 'markdownlint -c .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' }; From b238e7da7cc19bfffa9861ec211d196dd6b73736 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 05:13:27 +0000 Subject: [PATCH 2/3] chore(deps-dev): bump validate-branch-name from 1.3.0 to 1.3.1 Bumps [validate-branch-name](https://github.com/JsonMa/validate-branch-name) from 1.3.0 to 1.3.1. - [Release notes](https://github.com/JsonMa/validate-branch-name/releases) - [Changelog](https://github.com/JsonMa/validate-branch-name/blob/master/CHANGELOG.md) - [Commits](https://github.com/JsonMa/validate-branch-name/compare/v1.3.0...v1.3.1) --- updated-dependencies: - dependency-name: validate-branch-name dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 47 ++++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 25 insertions(+), 24 deletions(-) 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 e008b7957ec..c3da07fe5c5 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": { From 808d48f0518fe1b7d406d7d0e0184b64bcf546f4 Mon Sep 17 00:00:00 2001 From: Nicolas Merget <104347736+nmerget@users.noreply.github.com> Date: Fri, 26 Jul 2024 09:03:52 +0200 Subject: [PATCH 3/3] fix: issue with wrong snapshot (#2922) * fix: issue with wrong snapshot * fix: issue with wrong snapshot --------- Co-authored-by: Maximilian Franzke <787658+mfranzke@users.noreply.github.com> --- .../chromium/DBDrawer-should-autofocus.txt | 2 +- showcases/screen-reader/default.ts | 7 ++++++- showcases/screen-reader/tests/drawer.spec.ts | 19 ++++++++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-) 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); + } } }); });