diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/WidgetSelection/WidgetSelection_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/WidgetSelection/WidgetSelection_spec.js index 28e332c4c4..628c962605 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/WidgetSelection/WidgetSelection_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/WidgetSelection/WidgetSelection_spec.js @@ -46,4 +46,19 @@ describe("Widget Selection", function() { //should open property pane cy.get(`.t--property-pane-view`).should("have.length", 1); }); + + it("3. Should not select widgets if we hit CTRL + A on other Pages", function() { + // Switch to the Explorer Pane + cy.get("#switcher--explorer").click(); + // Click to create a New Data Source + cy.get(".t--entity-add-btn") + .eq(3) + .click(); + // Hit CTRL +A + cy.get("body").type("{ctrl}{a}"); + // Switch to the Canvas + cy.get("#switcher--widgets").click(); + // Widgets should not be selected + cy.get(".t--multi-selection-box").should("not.exist"); + }); }); diff --git a/app/client/src/pages/Editor/GlobalHotKeys.test.tsx b/app/client/src/pages/Editor/GlobalHotKeys.test.tsx index 83232662e3..c1b95d2b0f 100644 --- a/app/client/src/pages/Editor/GlobalHotKeys.test.tsx +++ b/app/client/src/pages/Editor/GlobalHotKeys.test.tsx @@ -30,6 +30,13 @@ import { SAVE_HOTKEY_TOASTER_MESSAGE, } from "@appsmith/constants/messages"; +jest.mock("constants/routes", () => { + return { + ...jest.requireActual("constants/routes"), + matchBuilderPath: () => true, + }; +}); + describe("Canvas Hot Keys", () => { const mockGetIsFetchingPage = jest.spyOn(utilities, "getIsFetchingPage"); const spyGetCanvasWidgetDsl = jest.spyOn(utilities, "getCanvasWidgetDsl");