Skip to content

Commit

Permalink
♿ add screen reader tests to profile-components (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
scottnath authored Mar 5, 2024
1 parent 270d4a2 commit a382329
Show file tree
Hide file tree
Showing 28 changed files with 879 additions and 248 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ jobs:
runs-on: ubuntu-latest
# Job steps
steps:
- uses: actions/checkout@v4
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
# 👇 Install dependencies with the same package manager used in the project (replace it as needed), e.g. yarn, npm, pnpm
run: npm i
run: npm ci
# 👇 Adds Chromatic as a step in the workflow
- name: Publish to Chromatic
uses: chromaui/action@v1
uses: chromaui/action@latest
# Chromatic GitHub Action options
with:
# 👇 Chromatic projectToken, refer to the manage page to obtain it.
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
onlyChanged: true
17 changes: 15 additions & 2 deletions .storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import path from 'path';
import { mergeConfig } from 'vite';
import turbosnap from 'vite-plugin-turbosnap';
/** @type { import('@storybook/web-components-vite').StorybookConfig } */
const config = {
stories: ['../src/github/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
Expand All @@ -18,10 +20,21 @@ const config = {
docs: {
autodocs: 'tag',
},
async viteFinal(config, options) {
async viteFinal(config, { configType }) {
// Ensures that the cache directory is inside the project directory
config.cacheDir = path.join(__dirname, '../node_modules/.vite');
return config;

return mergeConfig(config, {
plugins:
configType === "PRODUCTION"
? [
turbosnap({
// This should be the base path of your storybook. In monorepos, you may only need process.cwd().
rootDir: config.root ?? process.cwd(),
}),
]
: [],
});
},
};
export default config;
4 changes: 2 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { setCustomElementsManifest } from '@storybook/web-components';
import customElements from '../custom-elements.json';
import { globalTypesPrimer, decoratorsPrimer } from './primer-preview';
import { viewports } from './viewports';
import { stringify, parseify } from '../src/utils';
import { stringinator, parseify } from '../src/utils';
import "./storybook.css";

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

global.stringify = stringify;
global.stringinator = stringinator;
global.parseify = parseify;

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

0 comments on commit a382329

Please sign in to comment.