mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-05 10:14:30 +00:00
* feat(feedback): adopt 10-point recommendation scale * docs(feedback): keep OSS scale contract self-contained
18 lines
544 B
TypeScript
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);
|
|
});
|
|
});
|