diff --git a/public/app/features/explore/spec/helper/interactions.ts b/public/app/features/explore/spec/helper/interactions.ts index 3e1d4f246fc..a83dfb2d9c8 100644 --- a/public/app/features/explore/spec/helper/interactions.ts +++ b/public/app/features/explore/spec/helper/interactions.ts @@ -43,9 +43,10 @@ export const openQueryLibrary = async () => { const button = screen.getByRole('button', { name: 'Add query from library' }); await userEvent.click(button); await waitFor(async () => { - screen.getByRole('dialog', { - name: 'Drawer title Query library', + const container = screen.getByRole('dialog', { + name: /Drawer title/, }); + within(container).getByText('Query library'); }); }; diff --git a/public/app/features/explore/spec/helper/setup.tsx b/public/app/features/explore/spec/helper/setup.tsx index 9b5870691e3..de530b584cc 100644 --- a/public/app/features/explore/spec/helper/setup.tsx +++ b/public/app/features/explore/spec/helper/setup.tsx @@ -334,7 +334,8 @@ export const withinQueryHistory = () => { }; export const withinQueryLibrary = () => { - const container = screen.getByRole('dialog', { name: 'Drawer title Query library' }); + const container = screen.getByRole('dialog', { name: /Drawer title/ }); + within(container).getByText('Query library'); return within(container); };