Skip to content

Commit

Permalink
Update messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kylegach committed Jan 13, 2025
1 parent af159c9 commit 51dfb39
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export const addonA11yAddonTest: Fix<AddonA11yAddonTestOptions> = {
const introduction = dedent`
We have detected that you have ${picocolors.magenta(`@storybook/addon-a11y`)} and ${picocolors.magenta(`@storybook/experimental-addon-test`)} installed.
${picocolors.magenta(`@storybook/addon-a11y`)} integrates now with ${picocolors.magenta(`@storybook/experimental-addon-test`)} to provide automatic accessibility checks for your stories, powered by Axe and Vitest.
${picocolors.magenta(`@storybook/addon-a11y`)} now integrates with ${picocolors.magenta(`@storybook/experimental-addon-test`)} to provide automatic accessibility checks for your stories, powered by Axe and Vitest.
`;

const prompt = [introduction];
Expand All @@ -161,7 +161,7 @@ export const addonA11yAddonTest: Fix<AddonA11yAddonTestOptions> = {
if (!skipVitestSetupTransformation) {
if (transformedSetupCode === null) {
prompt.push(dedent`
${counter++}) We couldn't find or automatically update your ${picocolors.cyan(`.storybook/vitest.setup.<ts|js>`)} in your project to smoothly set up project annotations from ${picocolors.magenta(`@storybook/addon-a11y`)}.
${counter++}) We couldn't find or automatically update ${picocolors.cyan(`.storybook/vitest.setup.<ts|js>`)} in your project to smoothly set up project annotations from ${picocolors.magenta(`@storybook/addon-a11y`)}.
Please manually update your ${picocolors.cyan(`vitest.setup.ts`)} file to include the following:
${picocolors.gray('...')}
Expand Down Expand Up @@ -318,7 +318,7 @@ export async function transformPreviewFile(source: string, filePath: string) {
const indentation = lines[tagsLineIndex]?.match(/^\s*/)?.[0];

// Add the comment with the same indentation level
const comment = `${indentation}// a11y-test tag controls whether accessibility tests are run as part of a standalone Vitest test run\n${indentation}// For more information please visit: https://storybook.js.org/docs/writing-tests/accessibility-testing`;
const comment = `${indentation}// The \`a11y-test\` tag controls whether accessibility tests are run as part of a standalone Vitest test run\n${indentation}// For more information please visit: https://storybook.js.org/docs/writing-tests/accessibility-testing#configure-accessibility-tests-with-the-test-addon`;
lines.splice(tagsLineIndex, 0, comment);

return formatFileContent(filePath, lines.join('\n'));
Expand Down

0 comments on commit 51dfb39

Please sign in to comment.