From 989eeb2a8742100617c7918897c1912a580fb33a Mon Sep 17 00:00:00 2001 From: Suvarchal Kumar Cheedela <15322959+suvarchal@users.noreply.github.com> Date: Tue, 8 Apr 2025 07:20:36 +0200 Subject: [PATCH] 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 --- .../chat/__tests__/Announcement.spec.tsx | 16 ++++------------ webview-ui/tsconfig.app.json | 4 ++-- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/webview-ui/src/components/chat/__tests__/Announcement.spec.tsx b/webview-ui/src/components/chat/__tests__/Announcement.spec.tsx index 563a7055..1daea84f 100644 --- a/webview-ui/src/components/chat/__tests__/Announcement.spec.tsx +++ b/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() - expect(screen.getByText(/MCP server improvements:/)).toBeInTheDocument() - }) - - it("renders the 'See new changes' button feature", () => { - render() - expect(screen.getByText(/See it in action here./)).toBeInTheDocument() - }) - - it("renders the demo link", () => { - render() - expect(screen.getByText(/See a demo here./)).toBeInTheDocument() + // Updated text based on actual component output + expect(screen.getByText(/Enhanced MCP Support:/)).toBeInTheDocument() }) }) diff --git a/webview-ui/tsconfig.app.json b/webview-ui/tsconfig.app.json index 0f319648..85ce444c 100644 --- a/webview-ui/tsconfig.app.json +++ b/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"] }