Skip to content

Commit 366834c

Browse files
authored
test(ui): consolidate duplicate owner coverage (#133874)
1 parent 22ae641 commit 366834c

3 files changed

Lines changed: 1 addition & 52 deletions

File tree

‎ui/src/lib/chat/message-extract.test.ts‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ import { describe, expect, it } from "vitest";
44
import { extractText, extractTextCached, extractThinkingCached } from "./message-extract.ts";
55

66
describe("extractTextCached", () => {
7-
it("matches extractText output", () => {
8-
const message = {
9-
role: "assistant",
10-
content: [{ type: "text", text: "Hello there" }],
11-
};
12-
expect(extractTextCached(message)).toBe(extractText(message));
13-
});
14-
157
it("returns consistent text output for repeated calls", () => {
168
const message = {
179
role: "user",
@@ -145,7 +137,6 @@ describe("nullish messages", () => {
145137
for (const message of [undefined, null]) {
146138
expect(extractText(message)).toBeNull();
147139
expect(extractTextCached(message)).toBeNull();
148-
expect(extractText(message)).toBeNull();
149140
expect(extractThinkingCached(message)).toBeNull();
150141
}
151142
});

‎ui/src/lib/format.test.ts‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -184,36 +184,6 @@ describe("stripThinkingTags", () => {
184184
expect(stripThinkingTags("<final\nHello")).toBe("<final\nHello");
185185
expect(stripThinkingTags("Hello</final>")).toBe("Hello");
186186
});
187-
188-
it("strips <relevant-memories> blocks", () => {
189-
const input = [
190-
"<relevant-memories>",
191-
"The following memories may be relevant to this conversation:",
192-
"- Internal memory note",
193-
"</relevant-memories>",
194-
"",
195-
"User-visible answer",
196-
].join("\n");
197-
expect(stripThinkingTags(input)).toBe("User-visible answer");
198-
});
199-
200-
it("keeps relevant-memories tags in fenced code blocks", () => {
201-
const input = [
202-
"```xml",
203-
"<relevant-memories>",
204-
"sample",
205-
"</relevant-memories>",
206-
"```",
207-
"",
208-
"Visible text",
209-
].join("\n");
210-
expect(stripThinkingTags(input)).toBe(input);
211-
});
212-
213-
it("hides unfinished <relevant-memories> block tails", () => {
214-
const input = ["Hello", "<relevant-memories>", "internal-only"].join("\n");
215-
expect(stripThinkingTags(input)).toBe("Hello\n");
216-
});
217187
});
218188

219189
describe("formatUnknownText", () => {

‎ui/src/lib/toast.test.ts‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -90,19 +90,6 @@ describe("shared toast", () => {
9090
expect(host.querySelector(".app-toast")).toBeNull();
9191
});
9292

93-
it("runs its action once and dismisses", async () => {
94-
const host = await mountHost();
95-
const onAction = vi.fn();
96-
showToast({ message: "Archived", actionLabel: "Undo", onAction });
97-
await host.updateComplete;
98-
99-
host.querySelector<HTMLButtonElement>(".app-toast__action")?.click();
100-
await host.updateComplete;
101-
102-
expect(onAction).toHaveBeenCalledOnce();
103-
expect(host.querySelector(".app-toast")).toBeNull();
104-
});
105-
10693
it("preserves the dismissal reason when an exiting toast is replaced", async () => {
10794
vi.useFakeTimers();
10895
const host = await mountHost();
@@ -134,6 +121,7 @@ describe("shared toast", () => {
134121
await host.updateComplete;
135122
host.querySelector<HTMLButtonElement>(".app-toast__action")?.click();
136123
await host.updateComplete;
124+
expect(host.querySelector(".app-toast")).toBeNull();
137125

138126
showToast({ message: "Third", onDismiss: (reason) => reasons.push(reason) });
139127
await host.updateComplete;

0 commit comments

Comments
 (0)