Fix tests

This commit is contained in:
Matt Rubens
2025-02-01 12:15:03 -05:00
parent 14683cc3c5
commit 70ad037016
4 changed files with 45 additions and 0 deletions

View File

@@ -41,6 +41,7 @@ describe("ChatTextArea", () => {
// Default mock implementation for useExtensionState
;(useExtensionState as jest.Mock).mockReturnValue({
filePaths: [],
openedTabs: [],
apiConfiguration: {
apiProvider: "anthropic",
},
@@ -51,6 +52,7 @@ describe("ChatTextArea", () => {
it("should be disabled when textAreaDisabled is true", () => {
;(useExtensionState as jest.Mock).mockReturnValue({
filePaths: [],
openedTabs: [],
})
render(<ChatTextArea {...defaultProps} textAreaDisabled={true} />)
@@ -68,6 +70,7 @@ describe("ChatTextArea", () => {
;(useExtensionState as jest.Mock).mockReturnValue({
filePaths: [],
openedTabs: [],
apiConfiguration,
})
@@ -85,6 +88,7 @@ describe("ChatTextArea", () => {
it("should not send message when input is empty", () => {
;(useExtensionState as jest.Mock).mockReturnValue({
filePaths: [],
openedTabs: [],
apiConfiguration: {
apiProvider: "openrouter",
},
@@ -101,6 +105,7 @@ describe("ChatTextArea", () => {
it("should show loading state while enhancing", () => {
;(useExtensionState as jest.Mock).mockReturnValue({
filePaths: [],
openedTabs: [],
apiConfiguration: {
apiProvider: "openrouter",
},
@@ -123,6 +128,7 @@ describe("ChatTextArea", () => {
// Update apiConfiguration
;(useExtensionState as jest.Mock).mockReturnValue({
filePaths: [],
openedTabs: [],
apiConfiguration: {
apiProvider: "openrouter",
newSetting: "test",