diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 5593984949..fb67fe6526 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -40,6 +40,7 @@ jobs: env: NODE_ENV: production REACT_VERSION: ${{ matrix.react }} + INCLUDE_ONE_THEME: 'true' - name: Bundle dev pages run: node_modules/.bin/webpack --config pages/webpack.config.integ.cjs --output-path pages/lib/static-default diff --git a/src/__a11y__/a11y-onetheme-dark.test.ts b/src/__a11y__/a11y-onetheme-dark.test.ts new file mode 100644 index 0000000000..013aa6a1a4 --- /dev/null +++ b/src/__a11y__/a11y-onetheme-dark.test.ts @@ -0,0 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import runA11yTests from './run-a11y-tests'; + +runA11yTests('one-theme', 'dark'); diff --git a/src/__a11y__/a11y-onetheme-light.test.ts b/src/__a11y__/a11y-onetheme-light.test.ts new file mode 100644 index 0000000000..894c6ae550 --- /dev/null +++ b/src/__a11y__/a11y-onetheme-light.test.ts @@ -0,0 +1,5 @@ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 +import runA11yTests from './run-a11y-tests'; + +runA11yTests('one-theme', 'light'); diff --git a/src/__a11y__/run-a11y-tests.ts b/src/__a11y__/run-a11y-tests.ts index 3d43c8465e..082f3f86fc 100644 --- a/src/__a11y__/run-a11y-tests.ts +++ b/src/__a11y__/run-a11y-tests.ts @@ -6,7 +6,7 @@ import useBrowser from '@cloudscape-design/browser-test-tools/use-browser'; import { findAllPages } from '../__integ__/utils'; import A11yPageObject from './a11y-page-object'; -type Theme = 'visual-refresh'; +type Theme = 'visual-refresh' | 'one-theme'; type Mode = 'light' | 'dark'; function setupTest(url: string, testFn: (page: A11yPageObject) => Promise) { @@ -18,8 +18,9 @@ function setupTest(url: string, testFn: (page: A11yPageObject) => Promise) }); } -function urlFormatter(inputUrl: string, mode: Mode) { - return `#/${mode}/${inputUrl}`; +function urlFormatter(inputUrl: string, mode: Mode, theme: Theme) { + const params = theme === 'one-theme' ? '?oneTheme=true' : ''; + return `#/${mode}/${inputUrl}${params}`; } export default function runA11yTests(theme: Theme, mode: Mode, skip: string[] = []) { @@ -36,7 +37,7 @@ export default function runA11yTests(theme: Theme, mode: Mode, skip: string[] = 'app-layout-toolbar/without-toolbar-nested', ]; const testFunction = skipPages.includes(inputUrl) ? test.skip : test; - const url = urlFormatter(inputUrl, mode); + const url = urlFormatter(inputUrl, mode, theme); testFunction( url, setupTest(url, page => page.assertNoAxeViolations())