diff --git a/package-lock.json b/package-lock.json index 9a4dc3c..d348313 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@stassi/leaf", - "version": "0.0.66", + "version": "0.0.67", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@stassi/leaf", - "version": "0.0.66", + "version": "0.0.67", "cpu": [ "arm64", "x64" @@ -49,10 +49,10 @@ "eslint-plugin-jsonc": "^2.16.0", "eslint-plugin-no-unsanitized": "^4.1.2", "eslint-plugin-prettier": "^5.2.1", - "expect-puppeteer": "^10.1.3", + "expect-puppeteer": "^10.1.4", "jest": "^29.7.0", - "jest-environment-puppeteer": "^10.1.3", - "jest-puppeteer": "^10.1.3", + "jest-environment-puppeteer": "^10.1.4", + "jest-puppeteer": "^10.1.4", "prettier": "3.3.3", "puppeteer": "^23.6.0", "rollup": "^4.24.0", @@ -6187,9 +6187,9 @@ } }, "node_modules/expect-puppeteer": { - "version": "10.1.3", - "resolved": "https://registry.npmjs.org/expect-puppeteer/-/expect-puppeteer-10.1.3.tgz", - "integrity": "sha512-2t1D2t0AfBDMp8rMHEws6mRx1iXeER6sOrIm/8sxM3KxkY7O8AD6j5XfTtVJI6Updc/c4IiuFSz3o/82soHUdA==", + "version": "10.1.4", + "resolved": "https://registry.npmjs.org/expect-puppeteer/-/expect-puppeteer-10.1.4.tgz", + "integrity": "sha512-zNVzk/+TkPS/CuTlGSK7SjXuUpQiakXtUJhbTRrcPHop4jCWydPx9RlvHhQELzZYgXlLhIP+hvBzUNiN8WNAow==", "dev": true, "license": "MIT", "engines": { @@ -8200,9 +8200,9 @@ } }, "node_modules/jest-dev-server": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/jest-dev-server/-/jest-dev-server-10.1.1.tgz", - "integrity": "sha512-Yk9gmW/io2udONlhdrsC69ZGYM2CISvGItyYk9zD5QK3tGq8ZAJP27NDHma4hI6ey/zcaiqbrDkIf7dmpHq86w==", + "version": "10.1.4", + "resolved": "https://registry.npmjs.org/jest-dev-server/-/jest-dev-server-10.1.4.tgz", + "integrity": "sha512-bGQ6sedNGtT6AFHhCVqGTXMPz7UyJi/ZrhNBgyqsP0XU9N8acCEIfqZEA22rOaZ+NdEVsaltk6tL7UT6aXfI7w==", "dev": true, "license": "MIT", "dependencies": { @@ -8210,9 +8210,9 @@ "cwd": "^0.10.0", "find-process": "^1.4.7", "prompts": "^2.4.2", - "spawnd": "^10.1.1", + "spawnd": "^10.1.4", "tree-kill": "^1.2.2", - "wait-on": "^7.2.0" + "wait-on": "^8.0.1" }, "engines": { "node": ">=16" @@ -8482,16 +8482,16 @@ "license": "MIT" }, "node_modules/jest-environment-puppeteer": { - "version": "10.1.3", - "resolved": "https://registry.npmjs.org/jest-environment-puppeteer/-/jest-environment-puppeteer-10.1.3.tgz", - "integrity": "sha512-dHBP44r0f1RUis6kWTxYmPyoB2QWXeotzzRWVjIgbiLIVIaRsKkvj3pIscRXQbJIfwaTAT+W50h0URV47IMc1Q==", + "version": "10.1.4", + "resolved": "https://registry.npmjs.org/jest-environment-puppeteer/-/jest-environment-puppeteer-10.1.4.tgz", + "integrity": "sha512-cx2jzf1qZb6/vdmLbRccF0k/zSsoWlrXi8bg10GzrODxiwsRomVDszTfoOCRsQ+C1sbJ+ubI1PlryIvvYjITrA==", "dev": true, "license": "MIT", "dependencies": { "chalk": "^4.1.2", "cosmiconfig": "^8.3.6", "deepmerge": "^4.3.1", - "jest-dev-server": "^10.1.1", + "jest-dev-server": "^10.1.4", "jest-environment-node": "^29.7.0" }, "engines": { @@ -8749,14 +8749,14 @@ } }, "node_modules/jest-puppeteer": { - "version": "10.1.3", - "resolved": "https://registry.npmjs.org/jest-puppeteer/-/jest-puppeteer-10.1.3.tgz", - "integrity": "sha512-YQYrv7Wq3IWySyCsX6pmaSXq8VexELlxW073YvwKx6J4mchhTSHilIa5O0Wv2j95/pZtfAi/PzVmsOuCCcFlig==", + "version": "10.1.4", + "resolved": "https://registry.npmjs.org/jest-puppeteer/-/jest-puppeteer-10.1.4.tgz", + "integrity": "sha512-I9bADDn9EzpaL9QgzEtyJhd29PBv45rZJFPROUC2KWZHUs+5OGjzBOZKBzmqECdGv2GV/JL+NMdjqRJde2A36Q==", "dev": true, "license": "MIT", "dependencies": { - "expect-puppeteer": "^10.1.3", - "jest-environment-puppeteer": "^10.1.3" + "expect-puppeteer": "^10.1.4", + "jest-environment-puppeteer": "^10.1.4" }, "engines": { "node": ">=16" @@ -12414,9 +12414,9 @@ "license": "MIT" }, "node_modules/spawnd": { - "version": "10.1.1", - "resolved": "https://registry.npmjs.org/spawnd/-/spawnd-10.1.1.tgz", - "integrity": "sha512-kTim9sz8KuKX7ZcO8imlvEvbaJmFtFhT5tKS0WP5FRlmWLH5Pd9qj9u29nbMrvDcJPj8ltwOG+QAiZq928GKCw==", + "version": "10.1.4", + "resolved": "https://registry.npmjs.org/spawnd/-/spawnd-10.1.4.tgz", + "integrity": "sha512-drqHc0mKJmtMsiGMOCwzlc5eZ0RPtRvT7tQAluW2A0qUc0G7TQ8KLcn3E6K5qzkLkH2UkS3nYQiVGULvvsD9dw==", "dev": true, "license": "MIT", "dependencies": { @@ -13439,14 +13439,14 @@ } }, "node_modules/wait-on": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.2.0.tgz", - "integrity": "sha512-wCQcHkRazgjG5XoAq9jbTMLpNIjoSlZslrJ2+N9MxDsGEv1HnFoVjOCexL0ESva7Y9cu350j+DWADdk54s4AFQ==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-8.0.1.tgz", + "integrity": "sha512-1wWQOyR2LVVtaqrcIL2+OM+x7bkpmzVROa0Nf6FryXkS+er5Sa1kzFGjzZRqLnHa3n1rACFLeTwUqE1ETL9Mig==", "dev": true, "license": "MIT", "dependencies": { - "axios": "^1.6.1", - "joi": "^17.11.0", + "axios": "^1.7.7", + "joi": "^17.13.3", "lodash": "^4.17.21", "minimist": "^1.2.8", "rxjs": "^7.8.1" diff --git a/package.json b/package.json index 2e97562..cd4668c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@stassi/leaf", - "version": "0.0.66", + "version": "0.0.67", "description": "Leaflet adapter.", "keywords": [ "cartography", @@ -88,10 +88,10 @@ "eslint-plugin-jsonc": "^2.16.0", "eslint-plugin-no-unsanitized": "^4.1.2", "eslint-plugin-prettier": "^5.2.1", - "expect-puppeteer": "^10.1.3", + "expect-puppeteer": "^10.1.4", "jest": "^29.7.0", - "jest-environment-puppeteer": "^10.1.3", - "jest-puppeteer": "^10.1.3", + "jest-environment-puppeteer": "^10.1.4", + "jest-puppeteer": "^10.1.4", "prettier": "3.3.3", "puppeteer": "^23.6.0", "rollup": "^4.24.0", diff --git a/src/tutorial/accessibility/decorative.test.ts b/src/tutorial/accessibility/decorative.test.ts new file mode 100644 index 0000000..3073d45 --- /dev/null +++ b/src/tutorial/accessibility/decorative.test.ts @@ -0,0 +1,35 @@ +describe('decorative accessibility tutorial', (): void => { + beforeAll(async (): Promise => { + await page.goto('http://localhost:3001/tutorial/accessibility/decorative') + }) + + describe('map', (): void => { + describe('marker', (): void => { + describe('when repeatedly pressing Tab', (): void => { + it('should not obtain focus', async (): Promise => { + const tabPressesMaximum = 20 + let markerFocused = false, + tabPresses = 0 + + while (tabPresses < tabPressesMaximum) { + await page.keyboard.press('Tab') + tabPresses++ + + if ( + ( + await page.evaluate( + (): string => document.activeElement?.className ?? '', + ) + ).includes('leaflet-marker-icon') + ) { + markerFocused = true + break + } + } + + expect(markerFocused).toBe(false) + }) + }) + }) + }) +}) diff --git a/src/tutorial/open-street-map-tiles.test.ts b/src/tutorial/open-street-map-tiles.test.ts index 8d58e41..f86f38d 100644 --- a/src/tutorial/open-street-map-tiles.test.ts +++ b/src/tutorial/open-street-map-tiles.test.ts @@ -1,6 +1,7 @@ // eslint-disable-next-line jest/prefer-lowercase-title -- official case describe('OpenStreetMap tiles', (): void => { describe.each([ + 'accessibility/decorative', 'accessibility/interactive', 'dist/custom-icons', 'dist/mobile',