2021-09-06 13:51:15 +00:00
|
|
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
|
|
describe("booking pages", () => {
|
|
|
|
describe("free user", () => {
|
2021-09-18 16:33:42 +00:00
|
|
|
it("only one visible event", () => {
|
2021-09-06 13:51:15 +00:00
|
|
|
cy.visit("/free");
|
|
|
|
cy.get("[data-testid=event-types]").children().should("have.length", 1);
|
|
|
|
cy.get('[href="/free/30min"]').should("exist");
|
|
|
|
cy.get('[href="/free/60min"]').should("not.exist");
|
|
|
|
});
|
|
|
|
|
|
|
|
it("/free/30min is bookable", () => {
|
|
|
|
cy.request({
|
|
|
|
method: "GET",
|
|
|
|
url: "/free/30min",
|
|
|
|
failOnStatusCode: false,
|
|
|
|
}).then((res) => {
|
|
|
|
expect(res.status).to.eql(200);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-09-18 16:33:42 +00:00
|
|
|
it.skip("/free/60min is not bookable", () => {
|
2021-09-06 13:51:15 +00:00
|
|
|
cy.request({
|
|
|
|
method: "GET",
|
|
|
|
url: "/free/60min",
|
|
|
|
failOnStatusCode: false,
|
|
|
|
}).then((res) => {
|
|
|
|
expect(res.status).to.eql(404);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2021-09-18 16:33:42 +00:00
|
|
|
it("pro user's page has at least 2 visible events", () => {
|
2021-09-06 13:51:15 +00:00
|
|
|
cy.visit("/pro");
|
|
|
|
cy.get("[data-testid=event-types]").children().should("have.length.at.least", 2);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("free user with first hidden", () => {
|
|
|
|
it("has no visible events", () => {
|
|
|
|
cy.visit("/free-first-hidden");
|
|
|
|
cy.contains("This user hasn't set up any event types yet.");
|
|
|
|
});
|
|
|
|
|
2021-09-09 14:28:07 +00:00
|
|
|
it("/free-first-hidden/30min is bookable", () => {
|
2021-09-06 13:51:15 +00:00
|
|
|
cy.request({
|
|
|
|
method: "GET",
|
|
|
|
url: "/free-first-hidden/30min",
|
|
|
|
failOnStatusCode: false,
|
|
|
|
}).then((res) => {
|
2021-09-09 14:28:07 +00:00
|
|
|
expect(res.status).to.eql(200);
|
2021-09-06 13:51:15 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-09-18 16:33:42 +00:00
|
|
|
it.skip("/free-first-hidden/60min is not bookable", () => {
|
2021-09-06 13:51:15 +00:00
|
|
|
cy.request({
|
|
|
|
method: "GET",
|
|
|
|
url: "/free-first-hidden/60min",
|
|
|
|
failOnStatusCode: false,
|
|
|
|
}).then((res) => {
|
|
|
|
expect(res.status).to.eql(404);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|