From b8226cad0edf61c601380f59ac68e57a1dc5c369 Mon Sep 17 00:00:00 2001 From: Richard Lundeen Date: Tue, 1 Sep 2026 12:24:00 -0700 Subject: [PATCH 1/4] MAINT: Simplifying GUI Feedback Buttons Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 213b9228-bbd2-4dc8-a9b5-93cc6504e69c --- .../Feedback/FeedbackDialog.test.tsx | 17 ++++++++-------- .../components/Feedback/FeedbackDialog.tsx | 13 ++++++------ .../components/Sidebar/Navigation.test.tsx | 20 +++++++++---------- .../src/components/Sidebar/Navigation.tsx | 12 ----------- 4 files changed, 26 insertions(+), 36 deletions(-) diff --git a/frontend/src/components/Feedback/FeedbackDialog.test.tsx b/frontend/src/components/Feedback/FeedbackDialog.test.tsx index af623815fd..809a846000 100644 --- a/frontend/src/components/Feedback/FeedbackDialog.test.tsx +++ b/frontend/src/components/Feedback/FeedbackDialog.test.tsx @@ -47,19 +47,20 @@ describe("FeedbackDialog", () => { }); describe("shell", () => { - it("renders sensitive-info warning and links to the public repo", () => { + it("renders sensitive-info warning and links to the vulnerability process", () => { renderDialog(); expect(screen.getByText("Send feedback")).toBeInTheDocument(); const warning = screen.getByTestId("feedback-sensitive-warning"); - expect(warning).toHaveTextContent(/public/i); - expect(warning).toHaveTextContent(/secrets/i); - expect(warning).toHaveTextContent(/credentials/i); - expect(warning).toHaveTextContent(/customer data/i); - expect(warning).toHaveTextContent(/proprietary/i); + expect(warning).toHaveTextContent( + "Feedback is filed as a public GitHub issue. Do not include secrets, credentials, customer data, model endpoints, or other confidential or proprietary information. Do not use this form to report a security vulnerability. Follow the PyRIT security reporting process instead.", + ); expect( - screen.getByRole("link", { name: /github\.com\/microsoft\/PyRIT/i }), - ).toHaveAttribute("href", "https://github.com/microsoft/PyRIT/issues"); + screen.getByRole("link", { name: /PyRIT security reporting process/i }), + ).toHaveAttribute( + "href", + "https://github.com/microsoft/PyRIT/security/policy", + ); expect( screen.getByRole("link", { name: /microsoft privacy statement/i }), ).toHaveAttribute( diff --git a/frontend/src/components/Feedback/FeedbackDialog.tsx b/frontend/src/components/Feedback/FeedbackDialog.tsx index b4c64377fe..a04da3979f 100644 --- a/frontend/src/components/Feedback/FeedbackDialog.tsx +++ b/frontend/src/components/Feedback/FeedbackDialog.tsx @@ -247,17 +247,18 @@ export default function FeedbackDialog({ open, onClose, context }: FeedbackDialo }} > - GitHub issues are public. Please do not include secrets, credentials, - customer data, model endpoints, or other proprietary information. Your - feedback will be filed at{' '} + Feedback is filed as a public GitHub issue. Do not include secrets, + credentials, customer data, model endpoints, or other confidential or + proprietary information. Do not use this form to report a security + vulnerability. Follow the{' '} - github.com/microsoft/PyRIT + PyRIT security reporting process - . + {' '}instead. diff --git a/frontend/src/components/Sidebar/Navigation.test.tsx b/frontend/src/components/Sidebar/Navigation.test.tsx index 9a10672321..bac2181aec 100644 --- a/frontend/src/components/Sidebar/Navigation.test.tsx +++ b/frontend/src/components/Sidebar/Navigation.test.tsx @@ -3,7 +3,7 @@ * Licensed under the MIT license. */ -import { fireEvent, render, screen } from "@testing-library/react"; +import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import { ThemeProvider, useTheme } from "../../hooks/useTheme"; import Navigation from "./Navigation"; @@ -119,25 +119,25 @@ describe("Navigation", () => { ).toBeInTheDocument(); }); - it("renders the feedback button and forwards clicks to onOpenFeedback", () => { + it("renders one feedback button and forwards clicks to onOpenFeedback", async () => { + const user = userEvent.setup(); const onOpenFeedback = jest.fn(); renderWithProvider( ); - const feedbackButton = screen.getByTitle("Feedback"); - expect(feedbackButton).toBeInTheDocument(); - fireEvent.click(feedbackButton); + const feedbackButtons = screen.getAllByRole("button", { name: "Feedback" }); + expect(feedbackButtons).toHaveLength(1); + await user.click(feedbackButtons[0]); expect(onOpenFeedback).toHaveBeenCalledTimes(1); }); - it("links to the public security policy", () => { + it("does not render a direct security link", () => { renderWithProvider(); - expect(screen.getByRole("link", { name: "Security" })).toHaveAttribute( - "href", - "https://github.com/microsoft/PyRIT/security/policy" - ); + expect( + screen.queryByRole("link", { name: "Security" }) + ).not.toBeInTheDocument(); }); it("calls onNavigate with 'history' when history button is clicked", async () => { diff --git a/frontend/src/components/Sidebar/Navigation.tsx b/frontend/src/components/Sidebar/Navigation.tsx index 8a19b2fe35..1a6823d736 100644 --- a/frontend/src/components/Sidebar/Navigation.tsx +++ b/frontend/src/components/Sidebar/Navigation.tsx @@ -15,7 +15,6 @@ import { HistoryRegular, PersonFeedbackRegular, WrenchRegular, - OpenRegular, WeatherMoonRegular, WeatherSunnyRegular, TargetRegular, @@ -149,17 +148,6 @@ export default function Navigation({ aria-label="Feedback" onClick={onOpenFeedback} /> - - + {category === 'security' && ( + + )} + {isFeedbackCategory(category) && ( + + )} From 06ebffe82ddefb9ea15a4be3973a0da286103b77 Mon Sep 17 00:00:00 2001 From: Richard Lundeen Date: Tue, 1 Sep 2026 14:17:22 -0700 Subject: [PATCH 4/4] TEST: Stabilize initializer dialog interaction Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 213b9228-bbd2-4dc8-a9b5-93cc6504e69c --- frontend/src/components/Configuration/Configuration.test.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/Configuration/Configuration.test.tsx b/frontend/src/components/Configuration/Configuration.test.tsx index 6b3bff2754..e4f52abbb7 100644 --- a/frontend/src/components/Configuration/Configuration.test.tsx +++ b/frontend/src/components/Configuration/Configuration.test.tsx @@ -188,7 +188,7 @@ describe('Configuration', () => { 'C:/Users/test/.pyrit/custom_initializers/custom_target.py', { selector: 'label' }, )).toBeInTheDocument() - await user.click(screen.getByRole('button', { name: 'Add initializer' })) + fireEvent.click(screen.getByRole('button', { name: 'Add initializer' })) const dialog = screen.getByRole('dialog', { name: 'Add custom initializer' }) await user.type(within(dialog).getByRole('textbox', { name: /Initializer name/ }), 'new_custom') fireEvent.change(within(dialog).getByRole('textbox', { name: 'Python source' }), {