mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-08 10:45:52 +00:00
test(webui): realign thread-composer attach test with current types
This commit is contained in:
parent
707c0d7f3a
commit
e493eb09e7
@ -10,7 +10,7 @@ import { beforeEach, describe, expect, it, vi } from "vitest";
|
|||||||
import { ThreadComposer } from "@/components/thread/ThreadComposer";
|
import { ThreadComposer } from "@/components/thread/ThreadComposer";
|
||||||
import type { EncodeResponse } from "@/lib/imageEncode";
|
import type { EncodeResponse } from "@/lib/imageEncode";
|
||||||
|
|
||||||
const encodeImage = vi.fn<[File], Promise<EncodeResponse>>();
|
const encodeImage = vi.fn<(file: File) => Promise<EncodeResponse>>();
|
||||||
|
|
||||||
vi.mock("@/lib/imageEncode", async (importOriginal) => {
|
vi.mock("@/lib/imageEncode", async (importOriginal) => {
|
||||||
const actual = await importOriginal<typeof import("@/lib/imageEncode")>();
|
const actual = await importOriginal<typeof import("@/lib/imageEncode")>();
|
||||||
@ -29,10 +29,11 @@ function resolveReady(file: File): EncodeResponse {
|
|||||||
id: "stub",
|
id: "stub",
|
||||||
ok: true,
|
ok: true,
|
||||||
dataUrl: `data:image/png;base64,${btoa(file.name)}`,
|
dataUrl: `data:image/png;base64,${btoa(file.name)}`,
|
||||||
mimeType: "image/png",
|
mime: "image/png",
|
||||||
bytes: file.size,
|
bytes: file.size,
|
||||||
|
origBytes: file.size,
|
||||||
normalized: false,
|
normalized: false,
|
||||||
} as EncodeResponse;
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user