Skip to content

Commit

Permalink
fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
lublagg committed Dec 2, 2024
1 parent 9ba8050 commit 53b4a4a
Showing 1 changed file with 9 additions and 23 deletions.
32 changes: 9 additions & 23 deletions src/components/App.test.tsx
Original file line number Diff line number Diff line change
@@ -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(<App/>);
expect(screen.getByText("Loading...")).toBeDefined();
it("renders without crashing", async() => {
render(<App />);
expect(screen.getByText("Loading...")).toBeInTheDocument();
});
});

0 comments on commit 53b4a4a

Please sign in to comment.