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 <bartlett.dc.1@gmail.com>
This commit is contained in:
Suvarchal Kumar CheedelaandDennis Bartlett authored and GitHub committed 2025-04-07 22:20:36 -07:00
1 parent d5524e747a
commit 989eeb2a87
2 files changed
+6 -14

No files matched your search

@@ -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
View File
@@ -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"]
}