summaryrefslogtreecommitdiffhomepage
path: root/src/features/chat/logic/composer.test.ts
blob: 86e9dc4a94092b09fbe55b2244bc64ebe0d0fe39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { describe, expect, it } from "vitest";
import { stopButtonLabels } from "./composer";

describe("stopButtonLabels", () => {
  it.each([undefined, 0])("preserves plain Stop with queued count %s", (count) => {
    expect(stopButtonLabels(count)).toEqual({
      text: "Stop",
      ariaLabel: "Stop generation",
      title: undefined,
    });
  });

  it.each([1, 2])("labels the queued Stop action Flush with queued count %s", (count) => {
    expect(stopButtonLabels(count)).toEqual({
      text: "Flush",
      ariaLabel: "Flush",
      title: "Stop the current response and start the queued message now",
    });
  });
});