From 10934f11cb4adb33c0299651461012324d5a4b61 Mon Sep 17 00:00:00 2001 From: Cody Leff Date: Fri, 3 Feb 2023 14:44:08 -0800 Subject: [PATCH] Fix unit tests. --- .../EditDataset/UsageTab/UsageTab.test.tsx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/superset-frontend/src/views/CRUD/data/dataset/AddDataset/EditDataset/UsageTab/UsageTab.test.tsx b/superset-frontend/src/views/CRUD/data/dataset/AddDataset/EditDataset/UsageTab/UsageTab.test.tsx index 508a156cfcf1a..60bb986a27476 100644 --- a/superset-frontend/src/views/CRUD/data/dataset/AddDataset/EditDataset/UsageTab/UsageTab.test.tsx +++ b/superset-frontend/src/views/CRUD/data/dataset/AddDataset/EditDataset/UsageTab/UsageTab.test.tsx @@ -327,11 +327,20 @@ test('show chart dashboards', async () => { expect(chartDashboards[0]).toHaveAttribute('href', '/superset/dashboard/1'); expect(chartDashboards[1]).toHaveTextContent('Sample dashboard B'); expect(chartDashboards[1]).toHaveAttribute('href', '/superset/dashboard/2'); - expect(chartDashboards[0].parentNode).toBe(chartDashboards[1].parentNode); + expect(chartDashboards[0].closest('.ant-table-cell')).toBe( + chartDashboards[1].closest('.ant-table-cell'), + ); + expect(chartDashboards[2]).toHaveTextContent('Sample dashboard C'); expect(chartDashboards[2]).toHaveAttribute('href', '/superset/dashboard/3'); - expect(chartDashboards[2].parentNode).not.toBe(chartDashboards[0].parentNode); - expect(chartDashboards[2].parentNode).not.toBe(chartDashboards[1].parentNode); + expect(chartDashboards[2].closest('.ant-table-cell')).not.toBe( + chartDashboards[0].closest('.ant-table-cell'), + ); + + expect(chartDashboards[2].closest('.ant-table-cell')).not.toBe( + chartDashboards[1].closest('.ant-table-cell'), + ); + expectLastChartRequest(); expect(