mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-07 16:19:01 +00:00
Dispatchers can flag Aveta on Service and Notes and filter those rows without a site-level attribute.
18 lines
894 B
TypeScript
18 lines
894 B
TypeScript
import { screen } from "@testing-library/react";
|
|
import { describe, expect, it } from "vitest";
|
|
import { RescheduleCounterPill } from "@/app/(protected)/workorders/_components/list/table/cells/wo-counter-pills";
|
|
import { renderWithProviders } from "@/test/test-utils";
|
|
|
|
describe("RescheduleCounterPill", () => {
|
|
it("hides the pill when the count is below 2", () => {
|
|
const { container } = renderWithProviders(<RescheduleCounterPill count={1} />);
|
|
expect(container).toBeEmptyDOMElement();
|
|
});
|
|
|
|
it("renders a purple count pill with history tooltip from originalDate", () => {
|
|
renderWithProviders(<RescheduleCounterPill count={4} originalDate="2026-05-08" />);
|
|
const pill = screen.getByLabelText(/Rescheduled 4 times.*Original date: May 8, 2026/i);
|
|
expect(pill).toHaveStyle({ background: "#f5f3ff", color: "#7c3aed" });
|
|
expect(pill).toHaveTextContent("4");
|
|
});
|
|
});
|