Files
hyperframes/packages/cli/src/utils/feedbackRating.test.ts
T
Miguel Ángel 990f5c3145 feat(feedback): adopt 0–10 recommendation scale (#2438)
* feat(feedback): adopt 10-point recommendation scale

* docs(feedback): keep OSS scale contract self-contained
2026-07-14 15:46:47 -04:00

18 lines
544 B
TypeScript

import { describe, expect, it } from "vitest";
import { FEEDBACK_RATING_SCALE, parseFeedbackRating } from "./feedbackRating.js";
describe("parseFeedbackRating", () => {
it.each(["0", "10"])("accepts the NPS boundary %s", (raw) => {
expect(parseFeedbackRating(raw)).toBe(Number(raw));
});
it.each(["-1", "11", "4.5", "10x", ""])("rejects invalid rating %j", (raw) => {
expect(parseFeedbackRating(raw)).toBeNull();
});
it("declares the serialized rating scale", () => {
expect(FEEDBACK_RATING_SCALE).toBe(10);
});
});