mirror of
https://github.com/jgthms/bulma.git
synced 2024-11-14 11:14:24 +00:00
Add Title specs
This commit is contained in:
parent
1829e07f72
commit
07f32233dd
24
docs/cyp/elements/title.html
Normal file
24
docs/cyp/elements/title.html
Normal file
@ -0,0 +1,24 @@
|
||||
---
|
||||
layout: cypress
|
||||
title: Elements/Title
|
||||
---
|
||||
|
||||
<h1 id="title" class="title">
|
||||
Title <strong>strong</strong>
|
||||
</h1>
|
||||
|
||||
{% for i in (1..7) %}
|
||||
<p id="title-{{ i }}" class="title is-{{ i }}">
|
||||
Title <strong>size {{ i }}</strong>
|
||||
</p>
|
||||
{% endfor %}
|
||||
|
||||
<h1 id="subtitle" class="subtitle">
|
||||
Subtitle <strong>strong</strong>
|
||||
</h1>
|
||||
|
||||
{% for i in (1..7) %}
|
||||
<p id="subtitle-{{ i }}" class="subtitle is-{{ i }}">
|
||||
Subtitle <strong>size {{ i }}</strong>
|
||||
</p>
|
||||
{% endfor %}
|
63
docs/cypress/integration/elements/title.spec.js
Normal file
63
docs/cypress/integration/elements/title.spec.js
Normal file
@ -0,0 +1,63 @@
|
||||
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`);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user