shoc-frontend-new/src/test/app/(protected)/workorders/reschedule-counter-pill.test.tsx
Arthur Bassi 7a30335ab8 feat(work-orders): add per-WO Aveta indicators and advanced filter
Dispatchers can flag Aveta on Service and Notes and filter those rows
without a site-level attribute.
2026-08-24 15:16:51 -03:00

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");
});
});