2020-07-04 14:38:15 +02:00
|
|
|
describe("Selection action", () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
cy.viewport(1000, 600);
|
|
|
|
cy.visit("/");
|
2020-12-20 15:33:40 +01:00
|
|
|
cy.contains("0 Test game").parent().find("img").click();
|
2020-07-04 14:38:15 +02:00
|
|
|
// Way board loading
|
|
|
|
cy.get(".board-pane").should(
|
|
|
|
"have.css",
|
|
|
|
"transform",
|
|
|
|
"matrix(1, 0, 0, 1, 0, -200)"
|
|
|
|
);
|
2020-11-07 20:40:54 +01:00
|
|
|
cy.get(".item")
|
|
|
|
.first()
|
|
|
|
.children()
|
|
|
|
.first()
|
|
|
|
.should("have.css", "transform", "none");
|
2020-07-04 14:38:15 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should select multiple items with left click ", () => {
|
|
|
|
cy.get(".board")
|
2020-11-27 14:55:23 +01:00
|
|
|
.trigger("pointerdown", {
|
2020-11-21 21:03:58 +01:00
|
|
|
x: 350,
|
|
|
|
y: 500,
|
2020-11-27 14:55:23 +01:00
|
|
|
button: 0,
|
2020-11-21 21:03:58 +01:00
|
|
|
clientX: 350,
|
|
|
|
clientY: 500,
|
2020-11-27 14:55:23 +01:00
|
|
|
isPrimary: true,
|
2020-07-04 14:38:15 +02:00
|
|
|
})
|
2020-11-27 14:55:23 +01:00
|
|
|
.trigger("pointermove", {
|
2020-11-21 21:03:58 +01:00
|
|
|
x: 600,
|
|
|
|
y: 150,
|
2020-11-27 14:55:23 +01:00
|
|
|
button: 0,
|
2020-11-21 21:03:58 +01:00
|
|
|
clientX: 600,
|
|
|
|
clientY: 150,
|
2020-07-04 14:38:15 +02:00
|
|
|
force: true,
|
2020-11-27 14:55:23 +01:00
|
|
|
isPrimary: true,
|
2020-07-04 14:38:15 +02:00
|
|
|
});
|
|
|
|
|
2020-11-21 21:03:58 +01:00
|
|
|
cy.get(".selector").should(
|
|
|
|
"have.css",
|
|
|
|
"transform",
|
|
|
|
"matrix(1, 0, 0, 1, 350, 350)"
|
|
|
|
);
|
|
|
|
|
2020-11-27 14:55:23 +01:00
|
|
|
cy.get(".board").trigger("pointermove", {
|
2020-11-21 21:03:58 +01:00
|
|
|
x: 601,
|
|
|
|
y: 151,
|
2020-11-27 14:55:23 +01:00
|
|
|
button: 0,
|
2020-11-21 21:03:58 +01:00
|
|
|
clientX: 601,
|
|
|
|
clientY: 151,
|
2020-11-27 14:55:23 +01:00
|
|
|
isPrimary: true,
|
2020-11-21 21:03:58 +01:00
|
|
|
force: true,
|
|
|
|
});
|
|
|
|
|
|
|
|
cy.wait(500);
|
|
|
|
|
2020-11-27 14:55:23 +01:00
|
|
|
cy.get(".board").trigger("pointerup", {
|
|
|
|
isPrimary: true,
|
2020-11-21 21:03:58 +01:00
|
|
|
force: true,
|
|
|
|
});
|
|
|
|
|
2020-07-04 14:38:15 +02:00
|
|
|
cy.get("img[src='/games/AS.jpg']")
|
|
|
|
.parents(".item")
|
2020-11-21 21:03:58 +01:00
|
|
|
.should("have.class", "selected");
|
2020-07-04 14:38:15 +02:00
|
|
|
cy.get("img[src='/games/JC.jpg']")
|
|
|
|
.parents(".item")
|
2020-11-21 21:03:58 +01:00
|
|
|
.should("have.class", "selected");
|
|
|
|
cy.get("img[src='/games/BH.jpg']")
|
|
|
|
.parents(".item")
|
|
|
|
.should("have.class", "selected");
|
2020-07-04 14:38:15 +02:00
|
|
|
});
|
|
|
|
});
|