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:
Miguel Ángel
2026-07-14 15:46:47 -04:00
committed by GitHub
parent d2c8c2d808
commit 990f5c3145
18 changed files with 103 additions and 43 deletions
@@ -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);