dify/knowledge-fs/apps/api/src/source-product-options.test.ts
Jyong 4ee43b8afc chore: migrate knowledge-fs source tree
Import the committed KnowledgeFS snapshot dc4072ee302317145612087ce7440851dc329fd0 under knowledge-fs/ without its Git history, local IDE settings, or build artifacts.
2026-07-20 04:54:20 -04:00

28 lines
1.0 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { createApiSourceBulkRemovalRequester } from "./source-product-options";
describe("API Source product assembly", () => {
it("fails production startup when durable source removal cannot be assembled", () => {
expect(() => createApiSourceBulkRemovalRequester({ production: true })).toThrow(
"Production Source bulk removal requires the durable deletion repository",
);
});
it("keeps an unconfigured development Source product disabled", () => {
expect(createApiSourceBulkRemovalRequester({ production: false })).toBeUndefined();
});
it("assembles the production requester when the durable deletion repository exists", () => {
const requester = createApiSourceBulkRemovalRequester({
production: true,
repository: { requestSourceDeletion: async () => ({ created: true }) } as never,
});
expect(requester).toMatchObject({
find: expect.any(Function),
get: expect.any(Function),
request: expect.any(Function),
});
});
});