diff --git a/src/components/App.test.tsx b/src/components/App.test.tsx index 1720963..c7412ac 100755 --- a/src/components/App.test.tsx +++ b/src/components/App.test.tsx @@ -1,31 +1,17 @@ import React from "react"; -import "openai/shims/node"; -import { App } from "./App"; import { render, screen } from "@testing-library/react"; +import { App } from "./App"; -const mockOpenAi = jest.fn( - async () => ({ - id: "assistant-id", - }) -); - -jest.mock("../utils/llm-utils", () => ({ - initLlmConnection: () => ({ - beta: { - assistants: { - create: mockOpenAi - }, - threads: { - create: jest.fn() - } - } - }), - getTools: jest.fn() +jest.mock("../models/assistant-model", () => ({ + assistantStore: { + assistant: null, + initialize: jest.fn(), + }, })); describe("test load app", () => { - it("renders without crashing", () => { - render(); - expect(screen.getByText("Loading...")).toBeDefined(); + it("renders without crashing", async() => { + render(); + expect(screen.getByText("Loading...")).toBeInTheDocument(); }); });