mirror of
https://github.com/jgthms/bulma.git
synced 2025-01-09 15:44:25 +00:00
Add utils
This commit is contained in:
parent
41e28cff8a
commit
2a4ba6becd
@ -1,3 +1,5 @@
|
|||||||
|
import { setMobile, setDesktop } from "../utils";
|
||||||
|
|
||||||
describe("Components/Navbar", () => {
|
describe("Components/Navbar", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.visit("http://127.0.0.1:4000/cyp/components/navbar/");
|
cy.visit("http://127.0.0.1:4000/cyp/components/navbar/");
|
||||||
@ -125,10 +127,7 @@ describe("Components/Navbar", () => {
|
|||||||
describe("Components/Navbar Mobile", () => {
|
describe("Components/Navbar Mobile", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.visit("http://127.0.0.1:4000/cyp/components/navbar/");
|
cy.visit("http://127.0.0.1:4000/cyp/components/navbar/");
|
||||||
cy.viewport(
|
setMobile();
|
||||||
Cypress.env("viewports").mobile[0],
|
|
||||||
Cypress.env("viewports").mobile[1]
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("has a Navbar", () => {
|
it("has a Navbar", () => {
|
||||||
@ -182,10 +181,7 @@ describe("Components/Navbar Mobile", () => {
|
|||||||
describe("Components/Navbar Desktop", () => {
|
describe("Components/Navbar Desktop", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.visit("http://127.0.0.1:4000/cyp/components/navbar/");
|
cy.visit("http://127.0.0.1:4000/cyp/components/navbar/");
|
||||||
cy.viewport(
|
setDesktop();
|
||||||
Cypress.env("viewports").desktop[0],
|
|
||||||
Cypress.env("viewports").desktop[1]
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("has a Navbar", () => {
|
it("has a Navbar", () => {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import { setMobile, setTablet } from "../utils";
|
||||||
|
|
||||||
describe("Components/Pagination", () => {
|
describe("Components/Pagination", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.visit("http://127.0.0.1:4000/cyp/components/pagination/");
|
cy.visit("http://127.0.0.1:4000/cyp/components/pagination/");
|
||||||
@ -79,10 +81,7 @@ describe("Components/Pagination", () => {
|
|||||||
describe("Components/Pagination Mobile", () => {
|
describe("Components/Pagination Mobile", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.visit("http://127.0.0.1:4000/cyp/components/pagination/");
|
cy.visit("http://127.0.0.1:4000/cyp/components/pagination/");
|
||||||
cy.viewport(
|
setMobile();
|
||||||
Cypress.env("viewports").mobile[0],
|
|
||||||
Cypress.env("viewports").mobile[1]
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("has a correct Pagination", () => {
|
it("has a correct Pagination", () => {
|
||||||
@ -113,10 +112,7 @@ describe("Components/Pagination Mobile", () => {
|
|||||||
describe("Components/Navbar Tablet", () => {
|
describe("Components/Navbar Tablet", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.visit("http://127.0.0.1:4000/cyp/components/pagination/");
|
cy.visit("http://127.0.0.1:4000/cyp/components/pagination/");
|
||||||
cy.viewport(
|
setTablet();
|
||||||
Cypress.env("viewports").tablet[0],
|
|
||||||
Cypress.env("viewports").tablet[1]
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("has a correct Pagination", () => {
|
it("has a correct Pagination", () => {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import { setMobile, setDesktop } from "../utils";
|
||||||
|
|
||||||
describe("Elements/Container", () => {
|
describe("Elements/Container", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
cy.visit("http://127.0.0.1:4000/cyp/elements/container/");
|
cy.visit("http://127.0.0.1:4000/cyp/elements/container/");
|
||||||
@ -8,10 +10,7 @@ describe("Elements/Container", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("has fullwidth mobile Containers", () => {
|
it("has fullwidth mobile Containers", () => {
|
||||||
cy.viewport(
|
setMobile();
|
||||||
Cypress.env("viewports").mobile[0],
|
|
||||||
Cypress.env("viewports").mobile[1]
|
|
||||||
);
|
|
||||||
|
|
||||||
let viewport;
|
let viewport;
|
||||||
|
|
||||||
@ -45,10 +44,7 @@ describe("Elements/Container", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("has centered desktop Containers", () => {
|
it("has centered desktop Containers", () => {
|
||||||
cy.viewport(
|
setDesktop();
|
||||||
Cypress.env("viewports").desktop[0],
|
|
||||||
Cypress.env("viewports").desktop[1]
|
|
||||||
);
|
|
||||||
|
|
||||||
let viewport;
|
let viewport;
|
||||||
|
|
||||||
@ -77,10 +73,7 @@ describe("Elements/Container", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("has centered widescreen Containers", () => {
|
it("has centered widescreen Containers", () => {
|
||||||
cy.viewport(
|
setWidescreen();
|
||||||
Cypress.env("viewports").widescreen[0],
|
|
||||||
Cypress.env("viewports").widescreen[1]
|
|
||||||
);
|
|
||||||
|
|
||||||
let viewport;
|
let viewport;
|
||||||
|
|
||||||
@ -114,10 +107,7 @@ describe("Elements/Container", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it("has centered fullhd Containers", () => {
|
it("has centered fullhd Containers", () => {
|
||||||
cy.viewport(
|
setFullHD();
|
||||||
Cypress.env("viewports").fullhd[0],
|
|
||||||
Cypress.env("viewports").fullhd[1]
|
|
||||||
);
|
|
||||||
|
|
||||||
cy.get("#container").then(($) => {
|
cy.get("#container").then(($) => {
|
||||||
const cs = window.getComputedStyle($[0]);
|
const cs = window.getComputedStyle($[0]);
|
||||||
|
34
docs/cypress/integration/utils.js
Normal file
34
docs/cypress/integration/utils.js
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
export const setMobile = () => {
|
||||||
|
cy.viewport(
|
||||||
|
Cypress.env("viewports").mobile[0],
|
||||||
|
Cypress.env("viewports").mobile[1]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setTablet = () => {
|
||||||
|
cy.viewport(
|
||||||
|
Cypress.env("viewports").tablet[0],
|
||||||
|
Cypress.env("viewports").tablet[1]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setDesktop = () => {
|
||||||
|
cy.viewport(
|
||||||
|
Cypress.env("viewports").desktop[0],
|
||||||
|
Cypress.env("viewports").desktop[1]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setWidescreen = () => {
|
||||||
|
cy.viewport(
|
||||||
|
Cypress.env("viewports").widescreen[0],
|
||||||
|
Cypress.env("viewports").widescreen[1]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const setFullHD = () => {
|
||||||
|
cy.viewport(
|
||||||
|
Cypress.env("viewports").fullhd[0],
|
||||||
|
Cypress.env("viewports").fullhd[1]
|
||||||
|
);
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user