mirror of
https://github.com/TheRealOwenRees/echecsfrance.git
synced 2026-07-23 04:26:57 +00:00
nav updated
This commit is contained in:
@@ -12,38 +12,40 @@ const navbarFooterCheck = () => {
|
||||
});
|
||||
};
|
||||
|
||||
describe("Verify home page", () => {
|
||||
beforeEach(() => {
|
||||
cy.mount(<Home />);
|
||||
describe("Verify component mount", () => {
|
||||
describe("Verify home page", () => {
|
||||
beforeEach(() => {
|
||||
cy.mount(<Home />);
|
||||
});
|
||||
|
||||
it("correct h1 tags with website name included", () => {
|
||||
cy.get("h1").contains("echecs france", { matchCase: false });
|
||||
});
|
||||
|
||||
navbarFooterCheck();
|
||||
});
|
||||
|
||||
it("should have the correct h1 tags with website name included", () => {
|
||||
cy.get("h1").contains("echecs france", { matchCase: false });
|
||||
describe("Verify about page", () => {
|
||||
beforeEach(() => {
|
||||
cy.mount(<About />);
|
||||
});
|
||||
|
||||
it("correct h1 tags with page title included", () => {
|
||||
cy.get("h1").contains("about", { matchCase: false });
|
||||
});
|
||||
|
||||
navbarFooterCheck();
|
||||
});
|
||||
|
||||
navbarFooterCheck();
|
||||
});
|
||||
|
||||
describe("Verify about page", () => {
|
||||
beforeEach(() => {
|
||||
cy.mount(<About />);
|
||||
});
|
||||
|
||||
it("should have the correct h1 tags with page title included", () => {
|
||||
cy.get("h1").contains("about", { matchCase: false });
|
||||
});
|
||||
|
||||
navbarFooterCheck();
|
||||
});
|
||||
|
||||
describe("Verify contact page", () => {
|
||||
beforeEach(() => {
|
||||
cy.mount(<Contact />);
|
||||
});
|
||||
|
||||
it("should have the correct h1 tags with page title included", () => {
|
||||
cy.get("h1").contains("contact", { matchCase: false });
|
||||
});
|
||||
|
||||
navbarFooterCheck();
|
||||
describe("Verify contact page", () => {
|
||||
beforeEach(() => {
|
||||
cy.mount(<Contact />);
|
||||
});
|
||||
|
||||
it("correct h1 tags with page title included", () => {
|
||||
cy.get("h1").contains("contact", { matchCase: false });
|
||||
});
|
||||
|
||||
navbarFooterCheck();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
import { Tournament } from "@/types";
|
||||
import getTournaments from "@/utils/getTournamentData";
|
||||
import { createLayerGroups } from "@/utils/layerGroups";
|
||||
|
||||
// TODO cy.wrap() for promise resolution
|
||||
// TODO DRY - variables and data fetching can be done before tests under the first describe block
|
||||
|
||||
describe("Unit tests of utils directory", () => {
|
||||
describe("Retrieve tournament data from DB", () => {
|
||||
let response: Tournament[];
|
||||
let results: Tournament[];
|
||||
|
||||
describe("France", () => {
|
||||
before(async () => {
|
||||
response = await getTournaments("france");
|
||||
results = response.splice(0, 5);
|
||||
});
|
||||
|
||||
it("log first 5 results", () => {
|
||||
results.forEach((result) => cy.log(JSON.stringify(result)));
|
||||
});
|
||||
|
||||
it("check tournament urls are active", () => {
|
||||
results.forEach((result) => cy.request(result.url));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("Create layer groups for map markers", () => {
|
||||
let response: Tournament[];
|
||||
let results: Tournament[];
|
||||
describe("France", () => {
|
||||
const timeControls = [
|
||||
{ name: "Cadence Lente", colour: "green" },
|
||||
{ name: "Rapide", colour: "blue" },
|
||||
{ name: "Blitz", colour: "yellow" },
|
||||
{ name: "1h KO", colour: "red" },
|
||||
];
|
||||
|
||||
before(async () => {
|
||||
response = await getTournaments("france");
|
||||
results = response.splice(0, 5);
|
||||
});
|
||||
|
||||
it("generate layer groups", () => {
|
||||
const result = timeControls.map((timeControl) => {
|
||||
return createLayerGroups(timeControl.name, timeControl.colour, {
|
||||
tournamentData: results,
|
||||
});
|
||||
});
|
||||
cy.wrap(result.length).should("be.greaterThan", 0);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user