2021-04-02 20:34:17 +02:00
|
|
|
|
describe("Homepage", () => {
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
cy.visit("/games");
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("should show all available games by default", () => {
|
|
|
|
|
cy.contains("0 Test game").should("be.visible");
|
|
|
|
|
cy.contains("1 Performance game to test strange things and other").should(
|
|
|
|
|
"be.visible"
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("should show both default games if searching for 'test' string", () => {
|
2021-04-10 00:39:32 +02:00
|
|
|
|
cy.get('input[name="game-search"').type("test");
|
2021-04-02 20:34:17 +02:00
|
|
|
|
cy.contains("0 Test game").should("be.visible");
|
|
|
|
|
cy.contains("1 Performance game to test strange things and other").should(
|
|
|
|
|
"be.visible"
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("should show only game 1 if searching for 'Performance' string", () => {
|
2021-04-10 00:39:32 +02:00
|
|
|
|
cy.get('input[name="game-search"').type("Performance");
|
2021-04-02 20:34:17 +02:00
|
|
|
|
cy.contains("0 Test game").should("not.exist");
|
|
|
|
|
cy.contains("1 Performance game to test strange things and other").should(
|
|
|
|
|
"be.visible"
|
|
|
|
|
);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it("should not show any game for 'thisisafancystring' string", () => {
|
2021-04-10 00:39:32 +02:00
|
|
|
|
cy.get('input[name="game-search"').type("thisisafancystring");
|
2021-04-02 20:34:17 +02:00
|
|
|
|
cy.contains("0 Test game").should("not.exist");
|
|
|
|
|
cy.contains("1 Performance game to test strange things and other").should(
|
|
|
|
|
"not.exist"
|
|
|
|
|
);
|
|
|
|
|
});
|
2021-04-10 00:39:32 +02:00
|
|
|
|
|
|
|
|
|
it("should not show unpublished game by default", () => {
|
|
|
|
|
cy.contains("2 Unpublished game").should("not.exist");
|
|
|
|
|
});
|
2021-04-02 20:34:17 +02:00
|
|
|
|
});
|