From: Jeremy Thomas Date: Mon, 1 Nov 2021 09:51:24 +0000 (+0000) Subject: Add Progress and Table specs X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7e989d51212b6645d547263e24840bfc36934e7f;p=thirdparty%2Fbulma.git Add Progress and Table specs --- diff --git a/docs/cyp/elements/progress.html b/docs/cyp/elements/progress.html new file mode 100644 index 000000000..468f36de9 --- /dev/null +++ b/docs/cyp/elements/progress.html @@ -0,0 +1,15 @@ +--- +layout: cypress +title: Elements/Progress +--- + +
+ 15% +
+ +
+ 15% + 30% + 45% + 60% +
diff --git a/docs/cyp/elements/table.html b/docs/cyp/elements/table.html new file mode 100644 index 000000000..298d620eb --- /dev/null +++ b/docs/cyp/elements/table.html @@ -0,0 +1,50 @@ +--- +layout: cypress +title: Elements/Table +--- + +{% capture table_content %} + + + {% for j in (1..10) %} + {{ j }} + {% endfor %} + + + + {% for i in (1..5) %} + + {% for j in (1..10) %} + {{ j | times: i }} + {% endfor %} + + {% endfor %} + + {% for j in (1..10) %} + {{ j }} + {% endfor %} + + +{% endcapture %} + + + {{ table_content }} +
+ + + {{ table_content }} +
+ + + {{ table_content }} +
+ + + {{ table_content }} +
+ +
+ + {{ table_content }} +
+
diff --git a/docs/cypress.json b/docs/cypress.json index ad0d76c14..bdb54028a 100644 --- a/docs/cypress.json +++ b/docs/cypress.json @@ -69,6 +69,20 @@ "desktop": [1024, 800], "widescreen": [1216, 900], "fullhd": [1408, 1200] + }, + + "sizes": { + "1": 48, + "2": 40, + "3": 32, + "4": 24, + "5": 20, + "6": 16, + "7": 12, + "small": 12, + "normal": 16, + "medium": 20, + "large": 24 } } } diff --git a/docs/cypress/integration/elements/notification.spec.js b/docs/cypress/integration/elements/notification.spec.js index f5b1148c7..6ea467f59 100644 --- a/docs/cypress/integration/elements/notification.spec.js +++ b/docs/cypress/integration/elements/notification.spec.js @@ -1,4 +1,4 @@ -describe("Elements/notification", () => { +describe("Elements/Notification", () => { beforeEach(() => { cy.visit("http://127.0.0.1:4000/cyp/elements/notification/"); }); diff --git a/docs/cypress/integration/elements/progress.spec.js b/docs/cypress/integration/elements/progress.spec.js new file mode 100644 index 000000000..7e475149f --- /dev/null +++ b/docs/cypress/integration/elements/progress.spec.js @@ -0,0 +1,38 @@ +describe("Elements/Progress", () => { + beforeEach(() => { + cy.visit("http://127.0.0.1:4000/cyp/elements/progress/"); + }); + + it("has a Progress element", () => { + cy.get("#progress").should("exist"); + }); + + it("has a correct Progress", () => { + cy.get("#progress").then(($) => { + const cs = window.getComputedStyle($[0]); + expect(cs.height).to.equal(`${Cypress.env("sizes").normal}px`); + }); + }); + + it("has correct Progress sizes", () => { + cy.get("#progress-small").then(($) => { + const cs = window.getComputedStyle($[0]); + expect(cs.height).to.equal(`${Cypress.env("sizes").small}px`); + }); + + cy.get("#progress-normal").then(($) => { + const cs = window.getComputedStyle($[0]); + expect(cs.height).to.equal(`${Cypress.env("sizes").normal}px`); + }); + + cy.get("#progress-medium").then(($) => { + const cs = window.getComputedStyle($[0]); + expect(cs.height).to.equal(`${Cypress.env("sizes").medium}px`); + }); + + cy.get("#progress-large").then(($) => { + const cs = window.getComputedStyle($[0]); + expect(cs.height).to.equal(`${Cypress.env("sizes").large}px`); + }); + }); +}); diff --git a/docs/cypress/integration/elements/table.spec.js b/docs/cypress/integration/elements/table.spec.js new file mode 100644 index 000000000..07c914d8f --- /dev/null +++ b/docs/cypress/integration/elements/table.spec.js @@ -0,0 +1,16 @@ +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")); + }); + }); +});