diff --git a/.storybook/preview.jsx b/.storybook/preview.jsx index a921bcb..2ab41bd 100644 --- a/.storybook/preview.jsx +++ b/.storybook/preview.jsx @@ -97,6 +97,11 @@ export const parameters = { a11y: { config: { rules: [ + { + // TODO: for now the user avatar background color is generated with a simple algorithm but does not respect the ratio + id: 'color-contrast', + selector: '*:not(.MuiAvatar-circular.UserAvatar)', + }, { // A layout footer button targets a theming modal that we do not render to keep things simple, ignore this button violation id: 'aria-valid-attr-value', diff --git a/src/app/(public)/assistant/AssistantPage.stories.tsx b/src/app/(public)/assistant/AssistantPage.stories.tsx index 0cc0c35..0004338 100644 --- a/src/app/(public)/assistant/AssistantPage.stories.tsx +++ b/src/app/(public)/assistant/AssistantPage.stories.tsx @@ -23,7 +23,7 @@ async function playFindPlaceholerElement(canvasElement: HTMLElement): Promise { - return await within(canvasElement).findByText(/voluptatem/i); + return await within(canvasElement).findByText(/numquam/i); } const Template: StoryFn = (args) => { diff --git a/src/components/Avatar.tsx b/src/components/Avatar.tsx index f8aeaf6..bc787f0 100644 --- a/src/components/Avatar.tsx +++ b/src/components/Avatar.tsx @@ -49,7 +49,12 @@ export const Avatar = (props: AvatarProps) => { }, [props.size]); return ( - + {props.src ? null : extractInitials(props.fullName)} ); diff --git a/src/components/FlashMessage.stories.tsx b/src/components/FlashMessage.stories.tsx index 695cd45..31393ae 100644 --- a/src/components/FlashMessage.stories.tsx +++ b/src/components/FlashMessage.stories.tsx @@ -25,7 +25,7 @@ DevelopmentEnvStory.args = { nodeEnv: 'production', }; DevelopmentEnvStory.play = async ({ canvasElement }) => { - await within(canvasElement).findByText(/version/i); + await within(canvasElement).findByText(/merci/i); }; export const DevelopmentEnv = prepareStory(DevelopmentEnvStory); @@ -35,5 +35,8 @@ ProductionEnvStory.args = { appMode: 'prod', nodeEnv: 'production', }; +ProductionEnvStory.play = async ({ canvasElement }) => { + await within(canvasElement).findByText(/merci/i); +}; export const ProductionEnv = prepareStory(ProductionEnvStory);