mirror of
https://github.com/jgthms/bulma
synced 2026-03-22 05:04:28 -07:00
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
This commit is contained in:
53
docs/cypress/integration/elements/table.spec.js
Normal file
53
docs/cypress/integration/elements/table.spec.js
Normal file
@@ -0,0 +1,53 @@
|
||||
describe("Elements/Table", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit("http://127.0.0.1:4000/cyp/elements/table/");
|
||||
});
|
||||
|
||||
it("has a Table element", () => {
|
||||
cy.get("#table").should("exist");
|
||||
});
|
||||
|
||||
it("has a correct Table", () => {
|
||||
cy.get("#table").then(($) => {
|
||||
const cs = window.getComputedStyle($[0]);
|
||||
expect(cs.backgroundColor).to.equal(Cypress.env("white"));
|
||||
expect(cs.color).to.equal(Cypress.env("text-strong"));
|
||||
});
|
||||
|
||||
cy.get("#table tr.is-selected").then(($) => {
|
||||
const cs = window.getComputedStyle($[0]);
|
||||
expect(cs.backgroundColor).to.equal(Cypress.env("primary"));
|
||||
expect(cs.color).to.equal(Cypress.env("primary-invert"));
|
||||
});
|
||||
});
|
||||
|
||||
it("has a correct bordered Table", () => {
|
||||
cy.get("#table-bordered th, #table-bordered td").then(($) => {
|
||||
const cs = window.getComputedStyle($[0]);
|
||||
expect(cs.borderWidth).to.equal("1px");
|
||||
});
|
||||
});
|
||||
|
||||
it("has a correct striped Table", () => {
|
||||
cy.get("#table-striped tbody tr:not(.is-selected):nth-child(even)").then(
|
||||
($) => {
|
||||
const cs = window.getComputedStyle($[0]);
|
||||
expect(cs.backgroundColor).to.equal(Cypress.env("white-bis"));
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
it("has a correct narrow Table", () => {
|
||||
cy.get("#table-narrow th, #table-narrow td").then(($) => {
|
||||
const cs = window.getComputedStyle($[0]);
|
||||
expect(cs.padding).to.equal("4px 8px");
|
||||
});
|
||||
});
|
||||
|
||||
it("has a correct fullwidth Table", () => {
|
||||
cy.get("#table-fullwidth").then(($) => {
|
||||
const cs = window.getComputedStyle($[0]);
|
||||
expect(cs.width).to.equal("800px");
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user