Skip to content

Commit 4271b82

Browse files
authored
test: align plugin prerelease expectations (#104542)
* test: align plugin prerelease expectations * style: format browser doctor test
1 parent 4b33199 commit 4271b82

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

‎extensions/browser/src/doctor-browser.test.ts‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ function requireFirstNoteText(noteFn: ReturnType<typeof vi.fn>): string {
1414
return String(message);
1515
}
1616

17+
function requireNoteTextContaining(noteFn: ReturnType<typeof vi.fn>, expected: string): string {
18+
const call = noteFn.mock.calls.find(([message]) => String(message).includes(expected));
19+
if (!call) {
20+
throw new Error(`expected browser doctor note containing ${expected}`);
21+
}
22+
return String(call[0]);
23+
}
24+
1725
describe("browser doctor readiness", () => {
1826
it("does nothing when Chrome MCP is not configured", async () => {
1927
const noteFn = vi.fn();
@@ -164,14 +172,16 @@ describe("browser doctor readiness", () => {
164172
{
165173
noteFn,
166174
platform: "darwin",
175+
homeDir: "/__openclaw_browser_doctor_missing_home__",
167176
resolveChromeExecutable: () => null,
168177
},
169178
);
170179

171-
expect(noteFn).toHaveBeenCalledTimes(1);
172-
const note = requireFirstNoteText(noteFn);
173-
expect(note).toContain("Google Chrome was not found");
174-
expect(note).toContain("brave://inspect/#remote-debugging");
180+
const chromeNote = requireNoteTextContaining(noteFn, "Google Chrome was not found");
181+
expect(chromeNote).toContain("brave://inspect/#remote-debugging");
182+
const importNote = requireNoteTextContaining(noteFn, "System browser profile cookie import");
183+
expect(importNote).toContain("enabled");
184+
expect(importNote).toContain("Importable Chrome-family profile cookie databases found: 0");
175185
});
176186

177187
it("warns when detected Chrome is too old for Chrome MCP", async () => {

‎extensions/ollama/src/stream.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ describe("createOllamaStreamFn thinking events", () => {
374374
"start",
375375
"toolcall_start",
376376
"toolcall_delta",
377+
"toolcall_end",
377378
"done",
378379
]);
379380
const done = events.find((event) => event.type === "done") as {
@@ -422,6 +423,7 @@ describe("createOllamaStreamFn thinking events", () => {
422423
"start",
423424
"toolcall_start",
424425
"toolcall_delta",
426+
"toolcall_end",
425427
"done",
426428
]);
427429
const done = events.find((event) => event.type === "done") as {

0 commit comments

Comments
 (0)