From fd2a24b4b8b2c19157aa4039e792b614a548fb89 Mon Sep 17 00:00:00 2001 From: "nikolay.borovenskiy" Date: Wed, 27 Sep 2023 21:34:11 +0300 Subject: [PATCH] tests: [ZNO-2072] Fixed tests for HeaderActionsDropdown component --- .../HeaderActionsDropdown/HeaderActionsDropdown.test.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx index 218e2e4546118..f8b68cefce6aa 100644 --- a/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx +++ b/superset-frontend/src/dashboard/components/Header/HeaderActionsDropdown/HeaderActionsDropdown.test.tsx @@ -112,7 +112,8 @@ test('should render', () => { test('should render the dropdown button', () => { const mockedProps = createProps(); setup(mockedProps); - expect(screen.getByRole('button')).toBeInTheDocument(); + const dropdownButtons = screen.getAllByRole('button'); + expect(dropdownButtons[0]).toBeInTheDocument(); }); test('should render the menu items', async () => { @@ -121,7 +122,7 @@ test('should render the menu items', async () => { expect(screen.getAllByRole('menuitem')).toHaveLength(4); expect(screen.getByText('Refresh dashboard')).toBeInTheDocument(); expect(screen.getByText('Set auto-refresh interval')).toBeInTheDocument(); - expect(screen.getByText('Download as image')).toBeInTheDocument(); + expect(screen.getByText('Download')).toBeInTheDocument(); expect(screen.getByText('Enter fullscreen')).toBeInTheDocument(); });