Skip to content

Commit

Permalink
Merge branch 'refs/heads/release/1.17' into move-validation-to-bottom…
Browse files Browse the repository at this point in the history
…-fix-release-1.17-cherry-pick

# Conflicts:
#	designer/client/cypress/e2e/__image_snapshots__/electron/Linux/Fragment should allow adding input parameters and display used fragment graph in modal #1.png
  • Loading branch information
Dzuming committed Sep 18, 2024
2 parents d864ab1 + 0aa4201 commit 6baa486
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 12 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions designer/client/cypress/e2e/counts.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ describe("Counts", () => {
});

it("should be available via button and modal", () => {
// There is no other way to make this test works as expected since we cannot mock dynamic date here,
// and blackout or response mock has a little no sense in this case
const maxDiffThreshold = 0.02;
cy.viewport("macbook-15");

// Collapse toolbar to make counts button visible
Expand All @@ -20,7 +23,7 @@ describe("Counts", () => {

cy.get("[data-testid=window]").contains("Quick ranges").should("be.visible");
cy.contains(/^latest deploy$/i).should("not.exist");
cy.get("[data-testid=window]").matchImage();
cy.get("[data-testid=window]").matchImage({ maxDiffThreshold });
cy.get("[data-testid=window]")
.contains(/^cancel$/i)
.click();
Expand All @@ -29,7 +32,7 @@ describe("Counts", () => {
cy.get("@button").click();
cy.get("[data-testid=window]").contains("Quick ranges").should("be.visible");
cy.contains(/^latest deploy$/i).should("be.visible");
cy.get("[data-testid=window]").matchImage();
cy.get("[data-testid=window]").matchImage({ maxDiffThreshold });
cy.get("[data-testid=window]")
.contains(/^cancel$/i)
.click();
Expand All @@ -44,7 +47,7 @@ describe("Counts", () => {
cy.contains(/^previous deployments...$/i)
.should("be.visible")
.click();
cy.get("[data-testid=window]").matchImage();
cy.get("[data-testid=window]").matchImage({ maxDiffThreshold });
cy.get("[data-testid=window]").contains("no refresh").should("be.visible");
cy.get("[data-testid=window]").contains("Latest deploy").click();
cy.get("[data-testid=window]").contains("10 seconds").should("be.visible");
Expand Down
8 changes: 4 additions & 4 deletions designer/client/cypress/e2e/fragment.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ describe("Fragment", () => {
});

beforeEach(() => {
cy.viewport(1440, 1200);
cy.viewport("macbook-16");
});

it("should allow adding input parameters and display used fragment graph in modal", () => {
Expand Down Expand Up @@ -419,10 +419,10 @@ describe("Fragment", () => {
},
force: true,
});

cy.viewport("macbook-16");
cy.layoutScenario();

cy.get("@sendSms")
.parent()
.matchImage({ screenshotConfig: { padding: 16 } });
cy.get('[joint-selector="layers"]').matchImage({ screenshotConfig: { padding: 16 } });
});
});
5 changes: 0 additions & 5 deletions designer/client/cypress/support/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,8 @@ const mockWindowDate = () => {
// let originalDate: DateConstructor;

cy.on("window:before:load", (win) => {
// originalDate = win.Date;
Object.assign(win, { Date: FakeDate });
});

// cy.on("window:before:unload", (win) => {
// Object.assign(win, { Date: originalDate });
// });
};

Cypress.Commands.add("mockWindowDate", mockWindowDate);
Expand Down

0 comments on commit 6baa486

Please sign in to comment.