--- /dev/null
+---
+layout: cypress
+title: Components/Breadcrumb
+---
+
+{% capture content %}
+ <li><a href="#">Bulma</a></li>
+ <li><a href="#">Documentation</a></li>
+ <li><a href="#">Components</a></li>
+ <li class="is-active"><a href="#" aria-current="page">Breadcrumb</a></li>
+{% endcapture %}
+
+<nav id="breadcrumb" class="breadcrumb">
+ <ul>
+ {{ content }}
+ </ul>
+</nav>
+
+<nav id="breadcrumb-centered" class="breadcrumb is-centered">
+ <ul>
+ {{ content }}
+ </ul>
+</nav>
+
+<nav id="breadcrumb-right" class="breadcrumb is-right">
+ <ul>
+ {{ content }}
+ </ul>
+</nav>
+
+{% for size in site.data.sizes %}
+ <nav id="breadcrumb-{{ size }}" class="breadcrumb is-{{ size }}">
+ <ul>
+ {{ content }}
+ </ul>
+ </nav>
+{% endfor %}
+
+<nav id="breadcrumb-arrow" class="breadcrumb has-arrow-separator">
+ <ul>
+ {{ content }}
+ </ul>
+</nav>
+
+<nav id="breadcrumb-bullet" class="breadcrumb has-bullet-separator">
+ <ul>
+ {{ content }}
+ </ul>
+</nav>
+
+<nav id="breadcrumb-dot" class="breadcrumb has-dot-separator">
+ <ul>
+ {{ content }}
+ </ul>
+</nav>
+
+<nav id="breadcrumb-succeeds" class="breadcrumb has-succeeds-separator">
+ <ul>
+ {{ content }}
+ </ul>
+</nav>
--- /dev/null
+describe("Components/Breadcrumb", () => {
+ beforeEach(() => {
+ cy.visit("http://127.0.0.1:4000/cyp/components/breadcrumb/");
+ });
+
+ it("has a Breadcrumb", () => {
+ cy.get(".breadcrumb").should("exist");
+ });
+
+ it("has a correct Breadcrumb", () => {
+ cy.get("#breadcrumb").then(($) => {
+ const cs = window.getComputedStyle($[0]);
+ });
+
+ cy.get("#breadcrumb li:nth-child(2) a").then(($) => {
+ const cs = window.getComputedStyle($[0]);
+ expect(cs.color).to.equal(Cypress.env("link"));
+ expect(cs.padding).to.equal("0px 12px");
+ });
+
+ cy.get("#breadcrumb li.is-active a").then(($) => {
+ const cs = window.getComputedStyle($[0]);
+ expect(cs.color).to.equal(Cypress.env("text-strong"));
+ expect(cs.padding).to.equal("0px 12px");
+ });
+ });
+
+ it("has correct Breadcrumb alignments", () => {
+ cy.get("#breadcrumb-centered ul").then(($) => {
+ const cs = window.getComputedStyle($[0]);
+ expect(cs.justifyContent).to.equal("center");
+ });
+
+ cy.get("#breadcrumb-right ul").then(($) => {
+ const cs = window.getComputedStyle($[0]);
+ expect(cs.justifyContent).to.equal("flex-end");
+ });
+ });
+
+ it("has correct Breadcrumb sizes", () => {
+ cy.get("#breadcrumb-small").then(($) => {
+ const cs = window.getComputedStyle($[0]);
+ expect(cs.fontSize).to.equal(`${Cypress.env("sizes").small}px`);
+ });
+
+ cy.get("#breadcrumb-normal").then(($) => {
+ const cs = window.getComputedStyle($[0]);
+ expect(cs.fontSize).to.equal(`${Cypress.env("sizes").normal}px`);
+ });
+
+ cy.get("#breadcrumb-medium").then(($) => {
+ const cs = window.getComputedStyle($[0]);
+ expect(cs.fontSize).to.equal(`${Cypress.env("sizes").medium}px`);
+ });
+
+ cy.get("#breadcrumb-large").then(($) => {
+ const cs = window.getComputedStyle($[0]);
+ expect(cs.fontSize).to.equal(`${Cypress.env("sizes").large}px`);
+ });
+ });
+
+ it("has correct Breadcrumb separators", () => {
+ cy.get("#breadcrumb li:nth-child(2)").then(($) => {
+ const content = window
+ .getComputedStyle($[0], "before")
+ .getPropertyValue("content");
+ expect(content).to.equal('"/"');
+ });
+
+ cy.get("#breadcrumb-arrow li:nth-child(2)").then(($) => {
+ const content = window
+ .getComputedStyle($[0], "before")
+ .getPropertyValue("content");
+ expect(content).to.equal('"→"');
+ });
+
+ cy.get("#breadcrumb-bullet li:nth-child(2)").then(($) => {
+ const content = window
+ .getComputedStyle($[0], "before")
+ .getPropertyValue("content");
+ expect(content).to.equal('"•"');
+ });
+
+ cy.get("#breadcrumb-dot li:nth-child(2)").then(($) => {
+ const content = window
+ .getComputedStyle($[0], "before")
+ .getPropertyValue("content");
+ expect(content).to.equal('"·"');
+ });
+
+ cy.get("#breadcrumb-succeeds li:nth-child(2)").then(($) => {
+ const content = window
+ .getComputedStyle($[0], "before")
+ .getPropertyValue("content");
+ expect(content).to.equal('"≻"');
+ });
+ });
+});