From 81ac8efaefba353d6bd58b1652fc3683604e6bbb Mon Sep 17 00:00:00 2001 From: Hetu Nandu Date: Mon, 12 Feb 2024 18:37:37 +0530 Subject: [PATCH] fix: Entity Explorer Test (#31062) Fixes the entity explorer test that is failing due to a bad merge ## Summary by CodeRabbit - **Tests** - Improved the flow and validation of the `Widgets` tree node click event in tests. --- .../pages/Editor/Explorer/EntityExplorer.test.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/client/src/pages/Editor/Explorer/EntityExplorer.test.tsx b/app/client/src/pages/Editor/Explorer/EntityExplorer.test.tsx index 42660da8b7..0a2f29044c 100644 --- a/app/client/src/pages/Editor/Explorer/EntityExplorer.test.tsx +++ b/app/client/src/pages/Editor/Explorer/EntityExplorer.test.tsx @@ -81,6 +81,13 @@ describe("Entity Explorer tests", () => { , ); + const widgetsTree: any = component.queryByText("Widgets", { + selector: "div.t--entity-name", + }); + act(() => { + fireEvent.click(widgetsTree); + jest.runAllTimers(); + }); const tabsWidget = component.queryByText(children[0].widgetName); expect(tabsWidget).toBeTruthy(); }); @@ -106,13 +113,6 @@ describe("Entity Explorer tests", () => { , ); - const widgetsTree: any = component.queryByText("Widgets", { - selector: "div.t--entity-name", - }); - act(() => { - fireEvent.click(widgetsTree); - jest.runAllTimers(); - }); const tabsWidget: any = component.queryByText(children[0].widgetName); act(() => { fireEvent.click(tabsWidget);