]> git.ipfire.org Git - thirdparty/bulma.git/commitdiff
Add Progress and Table specs
authorJeremy Thomas <bbxdesign@gmail.com>
Mon, 1 Nov 2021 09:51:24 +0000 (09:51 +0000)
committerJeremy Thomas <bbxdesign@gmail.com>
Mon, 1 Nov 2021 09:51:24 +0000 (09:51 +0000)
docs/cyp/elements/progress.html [new file with mode: 0644]
docs/cyp/elements/table.html [new file with mode: 0644]
docs/cypress.json
docs/cypress/integration/elements/notification.spec.js
docs/cypress/integration/elements/progress.spec.js [new file with mode: 0644]
docs/cypress/integration/elements/table.spec.js [new file with mode: 0644]

diff --git a/docs/cyp/elements/progress.html b/docs/cyp/elements/progress.html
new file mode 100644 (file)
index 0000000..468f36d
--- /dev/null
@@ -0,0 +1,15 @@
+---
+layout: cypress
+title: Elements/Progress
+---
+
+<div class="block">
+  <progress id="progress" class="progress" value="15" max="100">15%</progress>
+</div>
+
+<div class="block">
+  <progress id="progress-small" class="progress is-small" value="15" max="100">15%</progress>
+  <progress id="progress-normal" class="progress" value="15" max="100">30%</progress>
+  <progress id="progress-medium" class="progress is-medium" value="15" max="100">45%</progress>
+  <progress id="progress-large" class="progress is-large" value="15" max="100">60%</progress>
+</div>
diff --git a/docs/cyp/elements/table.html b/docs/cyp/elements/table.html
new file mode 100644 (file)
index 0000000..298d620
--- /dev/null
@@ -0,0 +1,50 @@
+---
+layout: cypress
+title: Elements/Table
+---
+
+{% capture table_content %}
+  <thead>
+    <tr>
+      {% for j in (1..10) %}
+        <th>{{ j }}</th>
+      {% endfor %}
+    </tr>
+  </thead>
+  <tbody>
+    {% for i in (1..5) %}
+      <tr>
+        {% for j in (1..10) %}
+          <td>{{ j | times: i }}</td>
+        {% endfor %}
+      </tr>
+    {% endfor %}
+    <tr class="is-selected">
+      {% for j in (1..10) %}
+        <td>{{ j  }}</td>
+      {% endfor %}
+    </tr>
+  </tbody>
+{% endcapture %}
+
+<table id="table" class="table">
+  {{ table_content }}
+</table>
+
+<table id="table-bordered" class="table is-bordered">
+  {{ table_content }}
+</table>
+
+<table id="table-striped" class="table is-striped">
+  {{ table_content }}
+</table>
+
+<table id="table-narrow" class="table is-narrow">
+  {{ table_content }}
+</table>
+
+<div style="width: 800px;">
+  <table id="table-fullwidth" class="table is-fullwidth">
+    {{ table_content }}
+  </table>
+</div>
index ad0d76c14055682fcd9b0e0af92ffbf476f08a9a..bdb54028a537a9927c758d5705a2ace5be59eed2 100644 (file)
       "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
     }
   }
 }
index f5b1148c787d645f0bf37a831d451c02323d50fd..6ea467f594d62558959816d6c8717d62ba861e75 100644 (file)
@@ -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 (file)
index 0000000..7e47514
--- /dev/null
@@ -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 (file)
index 0000000..07c914d
--- /dev/null
@@ -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"));
+    });
+  });
+});