Skip to content

Commit

Permalink
All tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
msveshnikov committed Mar 24, 2024
1 parent b4b2880 commit a9bf512
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions src/components/__tests__/ChatHistory.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe("ChatHistory", () => {
},
{
user: "User",
assistant: null,
assistant: "Here is the response with an image",
fileType: "image/png",
userImageData: "base64data...",
error: null,
Expand All @@ -24,7 +24,7 @@ describe("ChatHistory", () => {
{ user: "User", assistant: null, fileType: null, userImageData: null, error: "An error occurred", image: null },
{
user: "User",
assistant: "Here is the response with an image",
assistant: null,
fileType: null,
userImageData: null,
error: null,
Expand Down Expand Up @@ -117,29 +117,29 @@ describe("ChatHistory", () => {
expect(modelOutputImage).toBeInTheDocument();
});

// test("renders file type icon", () => {
// render(
// <ChatHistory
// chatHistory={mockChatHistory}
// isModelResponding={false}
// chatContainerRef={null}
// getFileTypeIcon={mockGetFileTypeIcon}
// />
// );
// const fileTypeIcon = screen.getByText("📷");
// expect(fileTypeIcon).toBeInTheDocument();
// });
test("renders file type icon", () => {
render(
<ChatHistory
chatHistory={mockChatHistory}
isModelResponding={false}
chatContainerRef={null}
getFileTypeIcon={mockGetFileTypeIcon}
/>
);
const fileTypeIcon = screen.getByText("📷");
expect(fileTypeIcon).toBeInTheDocument();
});

// test("renders loading spinner when model is responding", () => {
// render(
// <ChatHistory
// chatHistory={mockChatHistory}
// isModelResponding={true}
// chatContainerRef={null}
// getFileTypeIcon={mockGetFileTypeIcon}
// />
// );
// const loadingSpinner = screen.getByRole("progressbar");
// expect(loadingSpinner).toBeInTheDocument();
// });
test("renders loading spinner when model is responding", () => {
render(
<ChatHistory
chatHistory={mockChatHistory}
isModelResponding={true}
chatContainerRef={null}
getFileTypeIcon={mockGetFileTypeIcon}
/>
);
const loadingSpinner = screen.getByRole("progressbar");
expect(loadingSpinner).toBeInTheDocument();
});
});

0 comments on commit a9bf512

Please sign in to comment.