diff --git a/frontend/src/container/ListOfDashboard/DashboardsList.tsx b/frontend/src/container/ListOfDashboard/DashboardsList.tsx
index 14718a562bc2..254a12b1958f 100644
--- a/frontend/src/container/ListOfDashboard/DashboardsList.tsx
+++ b/frontend/src/container/ListOfDashboard/DashboardsList.tsx
@@ -521,63 +521,65 @@ function DashboardsList(): JSX.Element {
{action && (
-
-
- }
- onClick={onClickHandler}
- >
- View
-
- }
- onClick={(e): void => {
- e.stopPropagation();
- e.preventDefault();
- setCopy(`${window.location.origin}${getLink()}`);
- }}
- >
- Copy Link
-
- }
- onClick={handleJsonExport}
- >
- Export JSON
-
-
-
-
- }
- placement="bottomRight"
- arrow={false}
- rootClassName="dashboard-actions"
- >
- {
- e.stopPropagation();
- e.preventDefault();
- }}
- />
-
+
+
+
+ }
+ onClick={onClickHandler}
+ >
+ View
+
+ }
+ onClick={(e): void => {
+ e.stopPropagation();
+ e.preventDefault();
+ setCopy(`${window.location.origin}${getLink()}`);
+ }}
+ >
+ Copy Link
+
+ }
+ onClick={handleJsonExport}
+ >
+ Export JSON
+
+
+
+
+ }
+ placement="bottomRight"
+ arrow={false}
+ rootClassName="dashboard-actions"
+ >
+ {
+ e.stopPropagation();
+ e.preventDefault();
+ }}
+ />
+
+
)}
diff --git a/frontend/src/pages/DashboardsListPage/__tests__/DashboardListPage.test.tsx b/frontend/src/pages/DashboardsListPage/__tests__/DashboardListPage.test.tsx
index 98bd40ef6259..bcb166eeb021 100644
--- a/frontend/src/pages/DashboardsListPage/__tests__/DashboardListPage.test.tsx
+++ b/frontend/src/pages/DashboardsListPage/__tests__/DashboardListPage.test.tsx
@@ -1,7 +1,10 @@
/* eslint-disable sonarjs/no-duplicate-string */
import ROUTES from 'constants/routes';
import DashboardsList from 'container/ListOfDashboard';
-import { dashboardEmptyState } from 'mocks-server/__mockdata__/dashboards';
+import {
+ dashboardEmptyState,
+ dashboardSuccessResponse,
+} from 'mocks-server/__mockdata__/dashboards';
import { server } from 'mocks-server/server';
import { rest } from 'msw';
import { DashboardProvider } from 'providers/Dashboard/Dashboard';
@@ -204,4 +207,24 @@ describe('dashboard list page', () => {
),
);
});
+
+ it('ensure that the popover actions on each list item renders list of options', async () => {
+ const { getByText, getAllByTestId } = render(
+
+
+
+
+ ,
+ );
+
+ await waitFor(() => {
+ const popovers = getAllByTestId('dashboard-action-popover');
+ expect(popovers).toHaveLength(dashboardSuccessResponse.data.length);
+ fireEvent.click([...popovers[0].children][0]);
+ });
+
+ expect(getByText('View')).toBeInTheDocument();
+ expect(getByText('Copy Link')).toBeInTheDocument();
+ expect(getByText('Export JSON')).toBeInTheDocument();
+ });
});