From 59b664d560038e867d6c12283480e54ac0dc4118 Mon Sep 17 00:00:00 2001 From: Anirudh Mani Date: Wed, 14 Aug 2024 15:07:06 -0700 Subject: [PATCH] fix: adjust selector for close button --- packages/odyssey-react-mui/src/Banner.tsx | 9 ++++++--- .../src/components/odyssey-mui/Banner/Banner.stories.tsx | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) 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;