Skip to content

Commit a382329

Browse files
authored
♿ add screen reader tests to profile-components (#19)
1 parent 270d4a2 commit a382329

28 files changed

+879
-248
lines changed

.github/workflows/chromatic.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,17 @@ jobs:
1111
runs-on: ubuntu-latest
1212
# Job steps
1313
steps:
14-
- uses: actions/checkout@v4
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
1518
- name: Install dependencies
16-
# 👇 Install dependencies with the same package manager used in the project (replace it as needed), e.g. yarn, npm, pnpm
17-
run: npm i
19+
run: npm ci
1820
# 👇 Adds Chromatic as a step in the workflow
1921
- name: Publish to Chromatic
20-
uses: chromaui/action@v1
22+
uses: chromaui/action@latest
2123
# Chromatic GitHub Action options
2224
with:
2325
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
24-
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
26+
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
27+
onlyChanged: true

.storybook/main.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import path from 'path';
2+
import { mergeConfig } from 'vite';
3+
import turbosnap from 'vite-plugin-turbosnap';
24
/** @type { import('@storybook/web-components-vite').StorybookConfig } */
35
const config = {
46
stories: ['../src/github/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
@@ -18,10 +20,21 @@ const config = {
1820
docs: {
1921
autodocs: 'tag',
2022
},
21-
async viteFinal(config, options) {
23+
async viteFinal(config, { configType }) {
2224
// Ensures that the cache directory is inside the project directory
2325
config.cacheDir = path.join(__dirname, '../node_modules/.vite');
24-
return config;
26+
27+
return mergeConfig(config, {
28+
plugins:
29+
configType === "PRODUCTION"
30+
? [
31+
turbosnap({
32+
// This should be the base path of your storybook. In monorepos, you may only need process.cwd().
33+
rootDir: config.root ?? process.cwd(),
34+
}),
35+
]
36+
: [],
37+
});
2538
},
2639
};
2740
export default config;

.storybook/preview.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { setCustomElementsManifest } from '@storybook/web-components';
22
import customElements from '../custom-elements.json';
33
import { globalTypesPrimer, decoratorsPrimer } from './primer-preview';
44
import { viewports } from './viewports';
5-
import { stringify, parseify } from '../src/utils';
5+
import { stringinator, parseify } from '../src/utils';
66
import "./storybook.css";
77

88
setCustomElementsManifest(customElements);
@@ -15,7 +15,7 @@ global.attrGen = (args) => Object.entries(args)
1515
.map(([key, value]) => `\n ${key}="${value}"`)
1616
.join(' ');
1717

18-
global.stringify = stringify;
18+
global.stringinator = stringinator;
1919
global.parseify = parseify;
2020

2121
/** @type { import('@storybook/web-components').Preview } */

0 commit comments

Comments
 (0)