Files
kandev/apps/web/lib/tasks/task-priority.test.ts
Henry f441399441 feat(tasks): show and set task priority on the kanban board (#3333)
Co-authored-by: nova28 <17953305+nova28@users.noreply.github.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Co-authored-by: Carlos Florencio <carlosmflorencio@gmail.com>
2026-09-05 10:15:19 +00:00

25 lines
829 B
TypeScript

import { describe, expect, it } from "vitest";
import { isTaskPriority, TASK_PRIORITY_LABEL_KEYS, TASK_PRIORITY_TOKENS } from "./task-priority";
describe("TASK_PRIORITY_TOKENS", () => {
it("lists the four tokens in severity order", () => {
expect(TASK_PRIORITY_TOKENS).toEqual(["critical", "high", "medium", "low"]);
});
it("has a label key for every token", () => {
for (const token of TASK_PRIORITY_TOKENS) {
expect(TASK_PRIORITY_LABEL_KEYS[token]).toMatch(/^kanban:priority/);
}
});
});
describe("isTaskPriority", () => {
it.each(["critical", "high", "medium", "low"])("accepts %s", (token) => {
expect(isTaskPriority(token)).toBe(true);
});
it.each([undefined, null, "", "urgent", "CRITICAL", 1, {}])("rejects %s", (value) => {
expect(isTaskPriority(value)).toBe(false);
});
});