2026-06-13 10:18:39 +08:00
|
|
|
import { describe, expect, it } from "vitest";
|
2026-06-20 05:07:46 +08:00
|
|
|
import { resolveToolPool, shouldSkipSyncWindow } from "../../../apps/api/src/lib/pool.js";
|
2026-06-13 10:18:39 +08:00
|
|
|
|
|
|
|
|
describe("pool routing", () => {
|
|
|
|
|
it("image tools stay on the image pool", () => {
|
|
|
|
|
expect(resolveToolPool("resize")).toBe("image");
|
|
|
|
|
});
|
|
|
|
|
it("ai tools route to the ai pool regardless of modality", () => {
|
|
|
|
|
expect(resolveToolPool("remove-background")).toBe("ai");
|
|
|
|
|
});
|
2026-06-17 15:54:48 +08:00
|
|
|
it("unknown tools default to system", () => {
|
|
|
|
|
expect(resolveToolPool("not-a-tool")).toBe("system");
|
2026-06-13 10:18:39 +08:00
|
|
|
});
|
|
|
|
|
it("long hint skips the sync window", () => {
|
|
|
|
|
expect(shouldSkipSyncWindow("long")).toBe(true);
|
|
|
|
|
expect(shouldSkipSyncWindow("fast")).toBe(false);
|
|
|
|
|
expect(shouldSkipSyncWindow(undefined)).toBe(false);
|
|
|
|
|
});
|
|
|
|
|
});
|