Explorar el Código

Fix failing webview UI tests for version 3.2 (#2707)

* Fix failing webview UI tests for Announcement component

* Remove unnecessary comments

* Fix Format

---------

Co-authored-by: Dennis Bartlett <[email protected]>
Suvarchal Kumar Cheedela hace 9 meses
padre
commit
989eeb2a87

+ 4 - 12
webview-ui/src/components/chat/__tests__/Announcement.spec.tsx

@@ -1,3 +1,4 @@
+import React from "react"
 import { render, screen, fireEvent } from "@testing-library/react"
 import { describe, it, expect, vi } from "vitest"
 import Announcement from "../Announcement"
@@ -22,18 +23,9 @@ describe("Announcement", () => {
 		expect(hideAnnouncement).toHaveBeenCalled()
 	})
 
-	it("renders the mcp server improvements announcement", () => {
+	it("renders the enhanced MCP support announcement", () => {
 		render(<Announcement version="2.0.0" hideAnnouncement={hideAnnouncement} />)
-		expect(screen.getByText(/MCP server improvements:/)).toBeInTheDocument()
-	})
-
-	it("renders the 'See new changes' button feature", () => {
-		render(<Announcement version="2.0.0" hideAnnouncement={hideAnnouncement} />)
-		expect(screen.getByText(/See it in action here./)).toBeInTheDocument()
-	})
-
-	it("renders the demo link", () => {
-		render(<Announcement version="2.0.0" hideAnnouncement={hideAnnouncement} />)
-		expect(screen.getByText(/See a demo here./)).toBeInTheDocument()
+		// Updated text based on actual component output
+		expect(screen.getByText(/Enhanced MCP Support:/)).toBeInTheDocument()
 	})
 })

+ 2 - 2
webview-ui/tsconfig.app.json

@@ -4,6 +4,7 @@
 		"target": "ES2020",
 		"useDefineForClassFields": true,
 		"lib": ["ES2020", "DOM", "DOM.Iterable"],
+		"types": ["vitest/globals", "@testing-library/jest-dom"],
 		"module": "ESNext",
 		"skipLibCheck": true,
 
@@ -30,6 +31,5 @@
 			"@utils/*": ["src/utils/*"]
 		}
 	},
-	"include": ["src"],
-	"exclude": ["src/**/__tests__/**"]
+	"include": ["src"]
 }