|
|
@@ -1,20 +1,23 @@
|
|
|
import { render, fireEvent, screen } from "@testing-library/react"
|
|
|
-import ChatTextArea from "../ChatTextArea"
|
|
|
+
|
|
|
+import { defaultModeSlug } from "@roo/modes"
|
|
|
+
|
|
|
import { useExtensionState } from "@src/context/ExtensionStateContext"
|
|
|
import { vscode } from "@src/utils/vscode"
|
|
|
-import { defaultModeSlug } from "@roo/modes"
|
|
|
import * as pathMentions from "@src/utils/path-mentions"
|
|
|
|
|
|
-// Mock modules
|
|
|
-jest.mock("@src/utils/vscode", () => ({
|
|
|
+import ChatTextArea from "../ChatTextArea"
|
|
|
+
|
|
|
+vi.mock("@src/utils/vscode", () => ({
|
|
|
vscode: {
|
|
|
- postMessage: jest.fn(),
|
|
|
+ postMessage: vi.fn(),
|
|
|
},
|
|
|
}))
|
|
|
-jest.mock("@src/components/common/CodeBlock")
|
|
|
-jest.mock("@src/components/common/MarkdownBlock")
|
|
|
-jest.mock("@src/utils/path-mentions", () => ({
|
|
|
- convertToMentionPath: jest.fn((path, cwd) => {
|
|
|
+
|
|
|
+vi.mock("@src/components/common/CodeBlock")
|
|
|
+vi.mock("@src/components/common/MarkdownBlock")
|
|
|
+vi.mock("@src/utils/path-mentions", () => ({
|
|
|
+ convertToMentionPath: vi.fn((path, cwd) => {
|
|
|
// Simple mock implementation that mimics the real function's behavior
|
|
|
if (cwd && path.toLowerCase().startsWith(cwd.toLowerCase())) {
|
|
|
const relativePath = path.substring(cwd.length)
|
|
|
@@ -25,11 +28,11 @@ jest.mock("@src/utils/path-mentions", () => ({
|
|
|
}))
|
|
|
|
|
|
// Get the mocked postMessage function
|
|
|
-const mockPostMessage = vscode.postMessage as jest.Mock
|
|
|
-const mockConvertToMentionPath = pathMentions.convertToMentionPath as jest.Mock
|
|
|
+const mockPostMessage = vscode.postMessage as ReturnType<typeof vi.fn>
|
|
|
+const mockConvertToMentionPath = pathMentions.convertToMentionPath as ReturnType<typeof vi.fn>
|
|
|
|
|
|
// Mock ExtensionStateContext
|
|
|
-jest.mock("@src/context/ExtensionStateContext")
|
|
|
+vi.mock("@src/context/ExtensionStateContext")
|
|
|
|
|
|
// Custom query function to get the enhance prompt button
|
|
|
const getEnhancePromptButton = () => {
|
|
|
@@ -44,25 +47,25 @@ const getEnhancePromptButton = () => {
|
|
|
describe("ChatTextArea", () => {
|
|
|
const defaultProps = {
|
|
|
inputValue: "",
|
|
|
- setInputValue: jest.fn(),
|
|
|
- onSend: jest.fn(),
|
|
|
+ setInputValue: vi.fn(),
|
|
|
+ onSend: vi.fn(),
|
|
|
sendingDisabled: false,
|
|
|
selectApiConfigDisabled: false,
|
|
|
- onSelectImages: jest.fn(),
|
|
|
+ onSelectImages: vi.fn(),
|
|
|
shouldDisableImages: false,
|
|
|
placeholderText: "Type a message...",
|
|
|
selectedImages: [],
|
|
|
- setSelectedImages: jest.fn(),
|
|
|
- onHeightChange: jest.fn(),
|
|
|
+ setSelectedImages: vi.fn(),
|
|
|
+ onHeightChange: vi.fn(),
|
|
|
mode: defaultModeSlug,
|
|
|
- setMode: jest.fn(),
|
|
|
+ setMode: vi.fn(),
|
|
|
modeShortcutText: "(⌘. for next mode)",
|
|
|
}
|
|
|
|
|
|
beforeEach(() => {
|
|
|
- jest.clearAllMocks()
|
|
|
+ vi.clearAllMocks()
|
|
|
// Default mock implementation for useExtensionState
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|
|
|
@@ -75,7 +78,7 @@ describe("ChatTextArea", () => {
|
|
|
|
|
|
describe("enhance prompt button", () => {
|
|
|
it("should be disabled when sendingDisabled is true", () => {
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
taskHistory: [],
|
|
|
@@ -94,7 +97,7 @@ describe("ChatTextArea", () => {
|
|
|
apiKey: "test-key",
|
|
|
}
|
|
|
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration,
|
|
|
@@ -114,7 +117,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should not send message when input is empty", () => {
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|
|
|
@@ -136,7 +139,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should show loading state while enhancing", () => {
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|
|
|
@@ -161,7 +164,7 @@ describe("ChatTextArea", () => {
|
|
|
const { rerender } = render(<ChatTextArea {...defaultProps} />)
|
|
|
|
|
|
// Update apiConfiguration
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|
|
|
@@ -181,7 +184,7 @@ describe("ChatTextArea", () => {
|
|
|
|
|
|
describe("enhanced prompt response", () => {
|
|
|
it("should update input value when receiving enhanced prompt", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
|
|
|
render(<ChatTextArea {...defaultProps} setInputValue={setInputValue} />)
|
|
|
|
|
|
@@ -203,8 +206,8 @@ describe("ChatTextArea", () => {
|
|
|
const mockCwd = "/Users/test/project"
|
|
|
|
|
|
beforeEach(() => {
|
|
|
- jest.clearAllMocks()
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ vi.clearAllMocks()
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
cwd: mockCwd,
|
|
|
@@ -213,7 +216,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should process multiple file paths separated by newlines", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="Initial text" />,
|
|
|
@@ -221,14 +224,14 @@ describe("ChatTextArea", () => {
|
|
|
|
|
|
// Create a mock dataTransfer object with text data containing multiple file paths
|
|
|
const dataTransfer = {
|
|
|
- getData: jest.fn().mockReturnValue("/Users/test/project/file1.js\n/Users/test/project/file2.js"),
|
|
|
+ getData: vi.fn().mockReturnValue("/Users/test/project/file1.js\n/Users/test/project/file2.js"),
|
|
|
files: [],
|
|
|
}
|
|
|
|
|
|
// Simulate drop event
|
|
|
fireEvent.drop(container.querySelector(".chat-text-area")!, {
|
|
|
dataTransfer,
|
|
|
- preventDefault: jest.fn(),
|
|
|
+ preventDefault: vi.fn(),
|
|
|
})
|
|
|
|
|
|
// Verify convertToMentionPath was called for each file path
|
|
|
@@ -242,7 +245,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should filter out empty lines in the dragged text", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="Initial text" />,
|
|
|
@@ -250,14 +253,14 @@ describe("ChatTextArea", () => {
|
|
|
|
|
|
// Create a mock dataTransfer object with text data containing empty lines
|
|
|
const dataTransfer = {
|
|
|
- getData: jest.fn().mockReturnValue("/Users/test/project/file1.js\n\n/Users/test/project/file2.js\n\n"),
|
|
|
+ getData: vi.fn().mockReturnValue("/Users/test/project/file1.js\n\n/Users/test/project/file2.js\n\n"),
|
|
|
files: [],
|
|
|
}
|
|
|
|
|
|
// Simulate drop event
|
|
|
fireEvent.drop(container.querySelector(".chat-text-area")!, {
|
|
|
dataTransfer,
|
|
|
- preventDefault: jest.fn(),
|
|
|
+ preventDefault: vi.fn(),
|
|
|
})
|
|
|
|
|
|
// Verify convertToMentionPath was called only for non-empty lines
|
|
|
@@ -268,7 +271,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should correctly update cursor position after adding multiple mentions", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const initialCursorPosition = 5
|
|
|
|
|
|
const { container } = render(
|
|
|
@@ -284,14 +287,14 @@ describe("ChatTextArea", () => {
|
|
|
|
|
|
// Create a mock dataTransfer object with text data
|
|
|
const dataTransfer = {
|
|
|
- getData: jest.fn().mockReturnValue("/Users/test/project/file1.js\n/Users/test/project/file2.js"),
|
|
|
+ getData: vi.fn().mockReturnValue("/Users/test/project/file1.js\n/Users/test/project/file2.js"),
|
|
|
files: [],
|
|
|
}
|
|
|
|
|
|
// Simulate drop event
|
|
|
fireEvent.drop(container.querySelector(".chat-text-area")!, {
|
|
|
dataTransfer,
|
|
|
- preventDefault: jest.fn(),
|
|
|
+ preventDefault: vi.fn(),
|
|
|
})
|
|
|
|
|
|
// The cursor position should be updated based on the implementation in the component
|
|
|
@@ -299,7 +302,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should handle very long file paths correctly", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
|
|
|
const { container } = render(<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />)
|
|
|
|
|
|
@@ -309,14 +312,14 @@ describe("ChatTextArea", () => {
|
|
|
|
|
|
// Create a mock dataTransfer object with the long path
|
|
|
const dataTransfer = {
|
|
|
- getData: jest.fn().mockReturnValue(longPath),
|
|
|
+ getData: vi.fn().mockReturnValue(longPath),
|
|
|
files: [],
|
|
|
}
|
|
|
|
|
|
// Simulate drop event
|
|
|
fireEvent.drop(container.querySelector(".chat-text-area")!, {
|
|
|
dataTransfer,
|
|
|
- preventDefault: jest.fn(),
|
|
|
+ preventDefault: vi.fn(),
|
|
|
})
|
|
|
|
|
|
// Verify convertToMentionPath was called with the long path
|
|
|
@@ -329,7 +332,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should handle paths with special characters correctly", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
|
|
|
const { container } = render(<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />)
|
|
|
|
|
|
@@ -341,16 +344,14 @@ describe("ChatTextArea", () => {
|
|
|
|
|
|
// Create a mock dataTransfer object with the special paths
|
|
|
const dataTransfer = {
|
|
|
- getData: jest
|
|
|
- .fn()
|
|
|
- .mockReturnValue(`${specialPath1}\n${specialPath2}\n${specialPath3}\n${specialPath4}`),
|
|
|
+ getData: vi.fn().mockReturnValue(`${specialPath1}\n${specialPath2}\n${specialPath3}\n${specialPath4}`),
|
|
|
files: [],
|
|
|
}
|
|
|
|
|
|
// Simulate drop event
|
|
|
fireEvent.drop(container.querySelector(".chat-text-area")!, {
|
|
|
dataTransfer,
|
|
|
- preventDefault: jest.fn(),
|
|
|
+ preventDefault: vi.fn(),
|
|
|
})
|
|
|
|
|
|
// Verify convertToMentionPath was called for each path
|
|
|
@@ -367,7 +368,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should handle paths outside the current working directory", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
|
|
|
const { container } = render(<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />)
|
|
|
|
|
|
@@ -381,14 +382,14 @@ describe("ChatTextArea", () => {
|
|
|
|
|
|
// Create a mock dataTransfer object with the outside path
|
|
|
const dataTransfer = {
|
|
|
- getData: jest.fn().mockReturnValue(outsidePath),
|
|
|
+ getData: vi.fn().mockReturnValue(outsidePath),
|
|
|
files: [],
|
|
|
}
|
|
|
|
|
|
// Simulate drop event
|
|
|
fireEvent.drop(container.querySelector(".chat-text-area")!, {
|
|
|
dataTransfer,
|
|
|
- preventDefault: jest.fn(),
|
|
|
+ preventDefault: vi.fn(),
|
|
|
})
|
|
|
|
|
|
// Verify convertToMentionPath was called with the outside path
|
|
|
@@ -399,7 +400,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should do nothing when dropped text is empty", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="Initial text" />,
|
|
|
@@ -407,14 +408,14 @@ describe("ChatTextArea", () => {
|
|
|
|
|
|
// Create a mock dataTransfer object with empty text
|
|
|
const dataTransfer = {
|
|
|
- getData: jest.fn().mockReturnValue(""),
|
|
|
+ getData: vi.fn().mockReturnValue(""),
|
|
|
files: [],
|
|
|
}
|
|
|
|
|
|
// Simulate drop event
|
|
|
fireEvent.drop(container.querySelector(".chat-text-area")!, {
|
|
|
dataTransfer,
|
|
|
- preventDefault: jest.fn(),
|
|
|
+ preventDefault: vi.fn(),
|
|
|
})
|
|
|
|
|
|
// Verify convertToMentionPath was not called
|
|
|
@@ -432,7 +433,7 @@ describe("ChatTextArea", () => {
|
|
|
]
|
|
|
|
|
|
beforeEach(() => {
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|
|
|
@@ -445,7 +446,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should navigate to previous prompt on arrow up", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />,
|
|
|
)
|
|
|
@@ -460,7 +461,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should navigate through history with multiple arrow up presses", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />,
|
|
|
)
|
|
|
@@ -480,7 +481,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should navigate forward with arrow down", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />,
|
|
|
)
|
|
|
@@ -498,7 +499,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should preserve current input when starting navigation", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="Current input" />,
|
|
|
)
|
|
|
@@ -517,7 +518,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should reset history navigation when user types", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />,
|
|
|
)
|
|
|
@@ -536,8 +537,8 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should reset history navigation when sending message", () => {
|
|
|
- const onSend = jest.fn()
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const onSend = vi.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea
|
|
|
{...defaultProps}
|
|
|
@@ -560,7 +561,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should navigate history when cursor is at first line", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />,
|
|
|
)
|
|
|
@@ -583,7 +584,7 @@ describe("ChatTextArea", () => {
|
|
|
{ type: "say", say: "user_feedback", text: "Workspace 1 prompt 2", ts: 3000 },
|
|
|
]
|
|
|
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|
|
|
@@ -594,7 +595,7 @@ describe("ChatTextArea", () => {
|
|
|
cwd: "/test/workspace",
|
|
|
})
|
|
|
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />,
|
|
|
)
|
|
|
@@ -611,7 +612,7 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should handle empty conversation history gracefully", () => {
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|
|
|
@@ -622,7 +623,7 @@ describe("ChatTextArea", () => {
|
|
|
cwd: "/test/workspace",
|
|
|
})
|
|
|
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />,
|
|
|
)
|
|
|
@@ -642,7 +643,7 @@ describe("ChatTextArea", () => {
|
|
|
{ type: "say", say: "user_feedback", text: "Another valid prompt", ts: 4000 },
|
|
|
]
|
|
|
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|
|
|
@@ -653,7 +654,7 @@ describe("ChatTextArea", () => {
|
|
|
cwd: "/test/workspace",
|
|
|
})
|
|
|
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />,
|
|
|
)
|
|
|
@@ -676,7 +677,7 @@ describe("ChatTextArea", () => {
|
|
|
{ task: "Third task", workspace: "/test/workspace" },
|
|
|
]
|
|
|
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|
|
|
@@ -687,7 +688,7 @@ describe("ChatTextArea", () => {
|
|
|
cwd: "/test/workspace",
|
|
|
})
|
|
|
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { container } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />,
|
|
|
)
|
|
|
@@ -704,13 +705,13 @@ describe("ChatTextArea", () => {
|
|
|
})
|
|
|
|
|
|
it("should reset navigation position when switching between history sources", () => {
|
|
|
- const setInputValue = jest.fn()
|
|
|
+ const setInputValue = vi.fn()
|
|
|
const { rerender } = render(
|
|
|
<ChatTextArea {...defaultProps} setInputValue={setInputValue} inputValue="" />,
|
|
|
)
|
|
|
|
|
|
// Start with task history
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|
|
|
@@ -733,7 +734,7 @@ describe("ChatTextArea", () => {
|
|
|
expect(setInputValue).toHaveBeenCalledWith("Task 1")
|
|
|
|
|
|
// Switch to conversation messages
|
|
|
- ;(useExtensionState as jest.Mock).mockReturnValue({
|
|
|
+ ;(useExtensionState as ReturnType<typeof vi.fn>).mockReturnValue({
|
|
|
filePaths: [],
|
|
|
openedTabs: [],
|
|
|
apiConfiguration: {
|