Add tiles specs

This commit is contained in:
Jeremy Thomas
2022-05-07 22:38:56 +01:00
parent 0e7659d624
commit 54c9c81e88
4 changed files with 169 additions and 0 deletions

View File

@@ -0,0 +1,50 @@
describe("Layout/Level", () => {
beforeEach(() => {
cy.visit("http://127.0.0.1:4000/cyp/layout/level/");
});
it("has a Level", () => {
cy.get(".level").should("exist");
});
it("has a correct Level", () => {
cy.get("#level").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.alignItems).to.equal("center");
expect(cs.display).to.equal("flex");
});
});
it("has a correct Level Item", () => {
cy.get("#level .level-item").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.alignItems).to.equal("center");
expect(cs.display).to.equal("flex");
expect(cs.flexGrow).to.equal("0");
expect(cs.flexShrink).to.equal("0");
});
cy.get("#level-centered .level-item .title").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.marginBottom).to.equal("0px");
});
});
it("has correct Level Left and Right", () => {
cy.get("#level .level-left").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.alignItems).to.equal("center");
expect(cs.flexGrow).to.equal("0");
expect(cs.flexShrink).to.equal("0");
expect(cs.justifyContent).to.equal("flex-start");
});
cy.get("#level .level-right").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.alignItems).to.equal("center");
expect(cs.flexGrow).to.equal("0");
expect(cs.flexShrink).to.equal("0");
expect(cs.justifyContent).to.equal("flex-end");
});
});
});

View File

@@ -0,0 +1,52 @@
describe("Components/Media", () => {
beforeEach(() => {
cy.visit("http://127.0.0.1:4000/cyp/layout/media/");
});
it("has a Media", () => {
cy.get(".media").should("exist");
});
it("has a correct Media", () => {
cy.get("#media").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.alignItems).to.equal("flex-start");
expect(cs.display).to.equal("flex");
});
});
it("has a correct nested Media", () => {
cy.get("#media-nested .media-content .media + .media").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.borderTopColor).to.equal("rgba(219, 219, 219, 0.5)");
expect(cs.borderTopStyle).to.equal("solid");
expect(cs.borderTopWidth).to.equal("1px");
expect(cs.marginTop).to.equal("8px");
expect(cs.paddingTop).to.equal("8px");
});
});
it("has a correct Media Content", () => {
cy.get("#media .media-content").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.flexGrow).to.equal("1");
expect(cs.flexShrink).to.equal("1");
});
});
it("has correct Media Left and Right", () => {
cy.get("#media .media-left").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.flexGrow).to.equal("0");
expect(cs.flexShrink).to.equal("0");
expect(cs.marginRight).to.equal("16px");
});
cy.get("#media .media-right").then(($) => {
const cs = window.getComputedStyle($[0]);
expect(cs.flexGrow).to.equal("0");
expect(cs.flexShrink).to.equal("0");
expect(cs.marginLeft).to.equal("16px");
});
});
});