diff --git a/frontend/__tests__/components/chat/ChatInterface.test.tsx b/frontend/__tests__/components/chat/ChatInterface.test.tsx
index 9fb431e4c9..b95d656e34 100644
--- a/frontend/__tests__/components/chat/ChatInterface.test.tsx
+++ b/frontend/__tests__/components/chat/ChatInterface.test.tsx
@@ -1,10 +1,8 @@
import { screen, act } from "@testing-library/react";
-import { afterEach, describe, expect, it, vi } from "vitest";
+import { describe, expect, it, vi } from "vitest";
import userEvent from "@testing-library/user-event";
import { renderWithProviders } from "test-utils";
import { createMemoryRouter, RouterProvider } from "react-router-dom";
-import Session from "#/services/session";
-import ActionType from "#/types/ActionType";
import { addAssistantMessage } from "#/state/chatSlice";
import AgentState from "#/types/AgentState";
import ChatInterface from "#/components/chat/ChatInterface";
@@ -34,9 +32,6 @@ HTMLElement.prototype.scrollTo = vi.fn().mockImplementation(() => {});
const TEST_TIMESTAMP = new Date().toISOString();
describe.skip("ChatInterface", () => {
- const sessionSendSpy = vi.spyOn(Session, "send");
- vi.spyOn(Session, "isConnected").mockReturnValue(true);
-
// TODO: replace below with e.g. fake timers
// https://vitest.dev/guide/mocking#timers
// https://vitest.dev/api/vi.html#vi-usefaketimers
@@ -66,19 +61,6 @@ describe.skip("ChatInterface", () => {
},
});
- const userMessageEvent = {
- action: ActionType.MESSAGE,
- args: {
- content: "my message",
- images_urls: [],
- timestamp: TEST_TIMESTAMP,
- },
- };
-
- afterEach(() => {
- sessionSendSpy.mockClear();
- });
-
it("should render empty message list and input", () => {
renderWithProviders();
expect(screen.queryAllByTestId("article")).toHaveLength(0);
@@ -125,10 +107,6 @@ describe.skip("ChatInterface", () => {
const input = screen.getByRole("textbox");
await user.type(input, "my message");
await user.keyboard("{Enter}");
-
- expect(sessionSendSpy).toHaveBeenCalledWith(
- expect.toMatchMessageEvent(JSON.stringify(userMessageEvent)),
- );
});
it("should send the user message as an event to the Session when the agent state is AWAITING_USER_INPUT", async () => {
@@ -144,10 +122,6 @@ describe.skip("ChatInterface", () => {
const input = screen.getByRole("textbox");
await user.type(input, "my message");
await user.keyboard("{Enter}");
-
- expect(sessionSendSpy).toHaveBeenCalledWith(
- expect.toMatchMessageEvent(JSON.stringify(userMessageEvent)),
- );
});
it("should disable the user input if agent is not initialized", async () => {
@@ -168,7 +142,6 @@ describe.skip("ChatInterface", () => {
);
expect(submitButton).toBeDisabled();
- expect(sessionSendSpy).not.toHaveBeenCalled();
});
it.todo("test scroll-related behaviour");
diff --git a/frontend/__tests__/components/chat/ConfirmationButtons.test.tsx b/frontend/__tests__/components/chat/ConfirmationButtons.test.tsx
deleted file mode 100644
index 7298a5ae48..0000000000
--- a/frontend/__tests__/components/chat/ConfirmationButtons.test.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { describe, expect, it, vi } from "vitest";
-import { userEvent } from "@testing-library/user-event";
-import { render, screen } from "@testing-library/react";
-import AgentState from "#/types/AgentState";
-import { changeAgentState } from "#/services/agentStateService";
-import ConfirmationButtons from "#/components/chat/ConfirmationButtons";
-
-describe("ConfirmationButtons", () => {
- vi.mock("#/services/agentStateService", () => ({
- changeAgentState: vi.fn(),
- }));
-
- it.skip("should change agent state appropriately on button click", async () => {
- const user = userEvent.setup();
- render();
-
- const confirmButton = screen.getByTestId("action-confirm-button");
- const rejectButton = screen.getByTestId("action-reject-button");
-
- await user.click(confirmButton);
- expect(changeAgentState).toHaveBeenCalledWith(AgentState.USER_CONFIRMED);
-
- await user.click(rejectButton);
- expect(changeAgentState).toHaveBeenCalledWith(AgentState.USER_REJECTED);
- });
-});
diff --git a/frontend/__tests__/components/modals/settings/AutocompleteCombobox.test.tsx b/frontend/__tests__/components/modals/settings/AutocompleteCombobox.test.tsx
deleted file mode 100644
index 16ede4eff6..0000000000
--- a/frontend/__tests__/components/modals/settings/AutocompleteCombobox.test.tsx
+++ /dev/null
@@ -1,82 +0,0 @@
-import { act, render, screen } from "@testing-library/react";
-import userEvent from "@testing-library/user-event";
-import { describe, expect, it, vi } from "vitest";
-import { AutocompleteCombobox } from "#/components/modals/settings/AutocompleteCombobox";
-
-const onChangeMock = vi.fn();
-
-const renderComponent = () =>
- render(
- ,
- );
-
-describe("AutocompleteCombobox", () => {
- it("should render a combobox with the default value", () => {
- renderComponent();
-
- const modelInput = screen.getByRole("combobox", { name: "model" });
- expect(modelInput).toHaveValue("model1");
- });
-
- it("should open a dropdown with the available values", async () => {
- renderComponent();
-
- const modelInput = screen.getByRole("combobox", { name: "model" });
-
- expect(screen.queryByText("model2")).not.toBeInTheDocument();
- expect(screen.queryByText("model3")).not.toBeInTheDocument();
-
- await act(async () => {
- await userEvent.click(modelInput);
- });
-
- expect(screen.getByText("model2")).toBeInTheDocument();
- expect(screen.getByText("model3")).toBeInTheDocument();
- });
-
- it("should call the onChange handler when a new value is selected", async () => {
- renderComponent();
-
- const modelInput = screen.getByRole("combobox", { name: "model" });
- expect(modelInput).toHaveValue("model1");
-
- await act(async () => {
- await userEvent.click(modelInput);
- });
-
- const model2 = screen.getByText("model2");
- await act(async () => {
- await userEvent.click(model2);
- });
-
- expect(onChangeMock).toHaveBeenCalledWith("model2");
- });
-
- it("should set the input value to the default key if the default key is not in the list", () => {
- render(
- ,
- );
-
- const modelInput = screen.getByRole("combobox", { name: "model" });
-
- expect(modelInput).toHaveValue("m2");
- });
-
- it.todo("should show a tooltip after 0.5 seconds of focus");
-});
diff --git a/frontend/__tests__/services/session.test.ts b/frontend/__tests__/services/session.test.ts
deleted file mode 100644
index 8bbfa309c2..0000000000
--- a/frontend/__tests__/services/session.test.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-import { afterEach, describe, expect, it, vi } from "vitest";
-import ActionType from "#/types/ActionType";
-import { Settings, saveSettings } from "../../src/services/settings";
-import Session from "../../src/services/session";
-
-const sendSpy = vi.spyOn(Session, "send");
-// @ts-expect-error - spying on private function
-const setupSpy = vi.spyOn(Session, "_setupSocket").mockImplementation(() => {
- // @ts-expect-error - calling a private function
- Session._initializeAgent();
-});
-
-describe("startNewSession", () => {
- afterEach(() => {
- sendSpy.mockClear();
- setupSpy.mockClear();
- });
-
- it("Should start a new session with the current settings", () => {
- const settings: Settings = {
- LLM_MODEL: "llm_value",
- LLM_BASE_URL: "base_url",
- AGENT: "agent_value",
- LANGUAGE: "language_value",
- LLM_API_KEY: "sk-...",
- CONFIRMATION_MODE: true,
- SECURITY_ANALYZER: "analyzer",
- };
-
- const event = {
- action: ActionType.INIT,
- args: settings,
- };
-
- saveSettings(settings);
- Session.startNewSession();
-
- expect(setupSpy).toHaveBeenCalledTimes(1);
- expect(sendSpy).toHaveBeenCalledWith(JSON.stringify(event));
- });
-});
diff --git a/frontend/src/components/modals/settings/AutocompleteCombobox.tsx b/frontend/src/components/modals/settings/AutocompleteCombobox.tsx
deleted file mode 100644
index 4c309e9990..0000000000
--- a/frontend/src/components/modals/settings/AutocompleteCombobox.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import { Autocomplete, AutocompleteItem, Tooltip } from "@nextui-org/react";
-import React from "react";
-import { useTranslation } from "react-i18next";
-import { I18nKey } from "#/i18n/declaration";
-
-type Label = "model" | "agent" | "language" | "securityanalyzer";
-
-const LABELS: Record