import { describe, expect, it } from "vitest";
import ConversationService from "#/api/conversation-service/conversation-service.api";
import {
  FILE_VARIANTS_1,
  FILE_VARIANTS_2,
} from "#/mocks/file-service-handlers";

/**
 * File service API tests. The actual API calls are mocked using MSW.
 * You can find the mock handlers in `frontend/src/mocks/file-service-handlers.ts`.
 */

describe("ConversationService File API", () => {
  it("should get a list of files", async () => {
    await expect(
      ConversationService.getFiles("test-conversation-id"),
    ).resolves.toEqual(FILE_VARIANTS_1);

    await expect(
      ConversationService.getFiles("test-conversation-id-2"),
    ).resolves.toEqual(FILE_VARIANTS_2);
  });

  it("should get content of a file", async () => {
    await expect(
      ConversationService.getFile("test-conversation-id", "file1.txt"),
    ).resolves.toEqual("Content of file1.txt");
  });
});
