mirror of
https://github.com/jgthms/bulma.git
synced 2024-11-28 12:24:23 +00:00
0ce084170a
* 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
96 lines
3.3 KiB
JavaScript
96 lines
3.3 KiB
JavaScript
describe("Components/Modal", () => {
|
|
beforeEach(() => {
|
|
cy.visit("http://127.0.0.1:4000/cyp/components/modal/");
|
|
});
|
|
|
|
it("has a Modal", () => {
|
|
cy.get(".modal").should("exist");
|
|
});
|
|
|
|
it("has a correct Modal", () => {
|
|
cy.get("#modal").then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.display).to.equal("none");
|
|
expect(cs.flexDirection).to.equal("column");
|
|
expect(cs.overflow).to.equal("hidden");
|
|
expect(cs.position).to.equal("fixed");
|
|
expect(cs.zIndex).to.equal("40");
|
|
});
|
|
|
|
cy.get("#modal-active").then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.display).to.equal("flex");
|
|
});
|
|
});
|
|
|
|
it("has a correct Modal Background", () => {
|
|
cy.get("#modal .modal-background").then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.backgroundColor).to.equal("rgba(10, 10, 10, 0.86)");
|
|
expect(cs.position).to.equal("absolute");
|
|
});
|
|
});
|
|
|
|
it("has a correct Modal Content", () => {
|
|
cy.get("#modal .modal-content").then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.margin).to.equal("0px auto");
|
|
expect(cs.width).to.equal("640px");
|
|
});
|
|
});
|
|
|
|
it("has a correct Modal Card", () => {
|
|
cy.get("#modal-card .modal-card").then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.display).to.equal("flex");
|
|
});
|
|
|
|
cy.get("#modal-card .modal-card-head, #modal-card .modal-card-foot").then(
|
|
($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.backgroundColor).to.equal(Cypress.env("white-ter"));
|
|
expect(cs.display).to.equal("flex");
|
|
expect(cs.flexShrink).to.equal("0");
|
|
expect(cs.padding).to.equal("20px");
|
|
expect(cs.position).to.equal("relative");
|
|
}
|
|
);
|
|
|
|
cy.get("#modal-card .modal-card-head").then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.borderBottomColor).to.equal(Cypress.env("border"));
|
|
expect(cs.borderBottomStyle).to.equal("solid");
|
|
expect(cs.borderBottomWidth).to.equal("1px");
|
|
expect(cs.borderTopLeftRadius).to.equal("6px");
|
|
expect(cs.borderTopRightRadius).to.equal("6px");
|
|
});
|
|
|
|
cy.get("#modal-card .modal-card-foot").then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.borderTopColor).to.equal(Cypress.env("border"));
|
|
expect(cs.borderTopStyle).to.equal("solid");
|
|
expect(cs.borderTopWidth).to.equal("1px");
|
|
expect(cs.borderBottomLeftRadius).to.equal("6px");
|
|
expect(cs.borderBottomRightRadius).to.equal("6px");
|
|
});
|
|
|
|
cy.get("#modal-card .modal-card-title").then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.color).to.equal(Cypress.env("text-strong"));
|
|
expect(cs.flexGrow).to.equal("1");
|
|
expect(cs.flexShrink).to.equal("0");
|
|
expect(cs.fontSize).to.equal("24px");
|
|
expect(cs.lineHeight).to.equal("24px");
|
|
});
|
|
|
|
cy.get("#modal-card .modal-card-body").then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.backgroundColor).to.equal(Cypress.env("white"));
|
|
expect(cs.flexGrow).to.equal("1");
|
|
expect(cs.flexShrink).to.equal("1");
|
|
expect(cs.overflow).to.equal("auto");
|
|
expect(cs.padding).to.equal("20px");
|
|
});
|
|
});
|
|
});
|