// Mockup https://www.figma.com/design/zsq2ahat30acTnumyy9aqC/00.Small-System?node-id=1235-8451&m=dev
/*
*
*
*
*/
import { html } from "lit";
describe("", () => {
it("should mount", () => {
cy.mount(html``);
cy.get("tems-datepicker-item").should("exist");
});
const defaultText = "99";
it("should display label", () => {
cy.mount(
html``,
);
cy.get("tems-datepicker-item").as("datepicker-item");
cy.get("@datepicker-item")
.find("button")
.and("have.css", "height", "24px")
.contains(defaultText);
});
it("should handle active attribute", () => {
cy.mount(
html``,
);
cy.get("tems-datepicker-item").as("datepicker-item");
cy.get("@datepicker-item").invoke("attr", "active").should("exist");
cy.get("@datepicker-item")
.find("button")
.and("have.css", "background-color", "rgb(255, 255, 255)")
.and("have.css", "border-color", "rgb(255, 33, 242)");
});
it("should handle selected attribute", () => {
cy.mount(
html``,
);
cy.get("tems-datepicker-item").as("datepicker-item");
cy.get("@datepicker-item").invoke("attr", "selected").should("exist");
cy.get("@datepicker-item").find("button").should("have.attr", "selected");
cy.get("@datepicker-item")
.find("button")
.and("have.css", "background-color", "rgb(255, 33, 242)");
});
it("should emit a click event", () => {
const onClickedSpy = cy.spy().as("handleClick");
cy.mount(
html``,
);
cy.get("tems-datepicker-item").find("button").click();
cy.get("@handleClick").should("have.been.called");
});
});