mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-08 10:46:06 +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:
@@ -38,6 +38,7 @@ describe("submitFeedback", () => {
|
||||
headers: { "content-type": "application/json", heygen_route: "canary" },
|
||||
body: JSON.stringify({
|
||||
rating: 4,
|
||||
rating_scale: 10,
|
||||
comment: "fast but font missing",
|
||||
cli_version: "1.2.3",
|
||||
env: "os=darwin/arm64 node=v22.11.0",
|
||||
@@ -47,6 +48,17 @@ describe("submitFeedback", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it.each([0, 10])("serializes the NPS boundary %i without changing it", async (rating) => {
|
||||
const fetchMock = vi.fn<typeof fetch>(async () => new Response(null, { status: 202 }));
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
|
||||
await submitFeedback({ rating, cliVersion: "1.2.3" });
|
||||
|
||||
const requestInit = fetchMock.mock.calls[0]?.[1];
|
||||
const body = JSON.parse(requestInit?.body as string);
|
||||
expect(body).toMatchObject({ rating, rating_scale: 10 });
|
||||
});
|
||||
|
||||
it("truncates over-long fields to the backend caps", async () => {
|
||||
const fetchMock = vi.fn<typeof fetch>(async () => new Response(null, { status: 202 }));
|
||||
vi.stubGlobal("fetch", fetchMock);
|
||||
|
||||
Reference in New Issue
Block a user