fix: Fixed jest test case and added cypress case

This commit is contained in:
Arsalan 2022-04-05 14:42:41 +05:30
parent 1bf80bd8b8
commit 589bdfc074
2 changed files with 22 additions and 0 deletions

View File

@ -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");
});
});

View File

@ -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");