mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 07:09:59 +00:00
feat(feedback): adopt 0–10 recommendation scale (#2438)
* feat(feedback): adopt 10-point recommendation scale * docs(feedback): keep OSS scale contract self-contained
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user