Files
bulma/docs/cypress/integration/elements/title.spec.js
Jeremy Thomas 0ce084170a Setup cypress (#3436)
* Setup Cypress tests for box and button

* Add container tests

* Add Cypress workflow

* Use npm install

* Update Cypress workflow

* Add Jekyll build

* Test other action

* Test custom setup

* Use other ruby action

* Test without flag

* Move cypress to docs folder

* Record runs

* Add Content, Icon, Image specs

* Add Notification specs

* Add Progress and Table specs

* Add Tags specs

* Add Title specs

* Add breadcrumb specs

* Add more specs

* Add media specs

* Add menu specs

* Add modal specs

* Add navbar specs

* Add pagination specs

* Add panel specs

* Add tabs specs, Add form checkbox radio specs

* Add utils

* Add file specs

* Add input textarea specs

* Add select specs

* Add form tools specs

* Add other elements specs

* Add footer and hero specs

* Add Hero specs

* Add section specs

* Add grid specs

* Add column sizes specs

* Add tiles specs

* Add generic specs

* Fix generic tests

* Make font family test looser

* Remove system-ui test

* Remove important flag

* Fix disabled select color
2022-05-08 13:55:16 +01:00

64 lines
1.9 KiB
JavaScript

describe("Elements/Title", () => {
beforeEach(() => {
cy.visit("http://127.0.0.1:4000/cyp/elements/title/");
});
it("has a Title", () => {
cy.get(".title").should("exist");
});
it("has a correct Title", () => {
cy.get("#title").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.color).to.equal(Cypress.env("text-strong"));
expect(cs.fontSize).to.equal(`${Cypress.env("sizes")["3"]}px`);
expect(cs.fontWeight).to.equal("600");
expect(cs.lineHeight).to.equal(`${Cypress.env("sizes")["3"] * 1.125}px`);
});
cy.get("#title strong").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.color).to.equal(Cypress.env("text-strong"));
expect(cs.fontWeight).to.equal("600");
});
});
it("has correct Title sizes", () => {
for (let i = 1; i <= 7; i++) {
cy.get(`#title-${i}`).then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.fontSize).to.equal(`${Cypress.env("sizes")[i]}px`);
});
}
});
it("has a Subtitle", () => {
cy.get(".subtitle").should("exist");
});
it("has a correct Subtitle", () => {
cy.get("#subtitle").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.color).to.equal(Cypress.env("text"));
expect(cs.fontSize).to.equal(`${Cypress.env("sizes")["5"]}px`);
expect(cs.fontWeight).to.equal("400");
expect(cs.lineHeight).to.equal(`${Cypress.env("sizes")["5"] * 1.25}px`);
});
cy.get("#subtitle strong").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.color).to.equal(Cypress.env("text-strong"));
expect(cs.fontWeight).to.equal("600");
});
});
it("has correct Subtitle sizes", () => {
for (let i = 1; i <= 7; i++) {
cy.get(`#subtitle-${i}`).then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.fontSize).to.equal(`${Cypress.env("sizes")[i]}px`);
});
}
});
});