diff --git a/packages/odyssey-react-mui/src/Banner.tsx b/packages/odyssey-react-mui/src/Banner.tsx index 0fa41296af..0d1b4dab11 100644 --- a/packages/odyssey-react-mui/src/Banner.tsx +++ b/packages/odyssey-react-mui/src/Banner.tsx @@ -39,10 +39,13 @@ export const BannerTestSelectors = { templateVariableNames: ["linkText"], }, }, - close: { + closeButton: { selector: { - method: "ByLabelText", - text: "${labelText}", + method: "ByRole", + options: { + name: "${labelText}", + }, + role: "button", templateVariableNames: ["labelText"], }, }, diff --git a/packages/odyssey-storybook/src/components/odyssey-mui/Banner/Banner.stories.tsx b/packages/odyssey-storybook/src/components/odyssey-mui/Banner/Banner.stories.tsx index b1c08e35c3..d793f66d24 100644 --- a/packages/odyssey-storybook/src/components/odyssey-mui/Banner/Banner.stories.tsx +++ b/packages/odyssey-storybook/src/components/odyssey-mui/Banner/Banner.stories.tsx @@ -184,7 +184,7 @@ export const Dismissible: StoryObj = { templateArgs: { role: "alert", }, - }).select?.("close", { + }).select?.("closeButton", { labelText: "Close", }).element;