mirror of
https://github.com/jgthms/bulma
synced 2026-03-15 18:24:30 -07:00
* 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
41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
describe("Elements/Notification", () => {
|
|
beforeEach(() => {
|
|
cy.visit("http://127.0.0.1:4000/cyp/elements/notification/");
|
|
});
|
|
|
|
it("has a Notification element", () => {
|
|
cy.get("#notification").should("exist");
|
|
});
|
|
|
|
it("has a correct Notification", () => {
|
|
cy.get("#notification").then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.backgroundColor).to.equal(Cypress.env("white-ter"));
|
|
expect(cs.borderRadius).to.equal("4px");
|
|
expect(cs.padding).to.equal("20px 40px 20px 24px");
|
|
});
|
|
});
|
|
|
|
it(`has correct color Notifications`, () => {
|
|
for (let i = 0; i < Cypress.env("color-names").length; i++) {
|
|
const name = Cypress.env("color-names")[i];
|
|
const baseColor = Cypress.env(name);
|
|
const invertColor = Cypress.env(`${name}-invert`);
|
|
const lightColor = Cypress.env(`${name}-light`);
|
|
const darkColor = Cypress.env(`${name}-dark`);
|
|
|
|
cy.get(`#notification-${name}`).then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.backgroundColor).to.equal(baseColor);
|
|
expect(cs.color).to.equal(invertColor);
|
|
});
|
|
|
|
cy.get(`#notification-${name}-light`).then(($) => {
|
|
const cs = window.getComputedStyle($[0]);
|
|
expect(cs.backgroundColor).to.equal(lightColor);
|
|
expect(cs.color).to.equal(darkColor);
|
|
});
|
|
}
|
|
});
|
|
});
|