From 1c7d78022cc6b87da827690185c4052b5a3a41ed Mon Sep 17 00:00:00 2001 From: Andrew Baldwin Date: Thu, 28 Nov 2024 08:28:23 -0500 Subject: [PATCH] Webui links should be relative --- locust/webui/src/components/Reports/Reports.test.tsx | 12 ++++++------ locust/webui/src/components/Reports/Reports.tsx | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/locust/webui/src/components/Reports/Reports.test.tsx b/locust/webui/src/components/Reports/Reports.test.tsx index f409ea5953..66c5d134a2 100644 --- a/locust/webui/src/components/Reports/Reports.test.tsx +++ b/locust/webui/src/components/Reports/Reports.test.tsx @@ -10,7 +10,7 @@ describe('Reports', () => { const link = getByText('Download requests CSV'); expect(link).toBeTruthy(); - expect(link.getAttribute('href')).toBe('/stats/requests/csv'); + expect(link.getAttribute('href')).toBe('./stats/requests/csv'); }); test('renders a link to download failures CSV', () => { @@ -19,7 +19,7 @@ describe('Reports', () => { const link = getByText('Download failures CSV'); expect(link).toBeTruthy(); - expect(link.getAttribute('href')).toBe('/stats/failures/csv'); + expect(link.getAttribute('href')).toBe('./stats/failures/csv'); }); test('renders a link to download exceptions CSV', () => { @@ -28,7 +28,7 @@ describe('Reports', () => { const link = getByText('Download exceptions CSV'); expect(link).toBeTruthy(); - expect(link.getAttribute('href')).toBe('/exceptions/csv'); + expect(link.getAttribute('href')).toBe('./exceptions/csv'); }); test('renders a link to download stats history CSV when enabled', () => { @@ -41,7 +41,7 @@ describe('Reports', () => { const link = getByText('Download full request statistics history CSV'); expect(link).toBeTruthy(); - expect(link.getAttribute('href')).toBe('/stats/requests_full_history/csv'); + expect(link.getAttribute('href')).toBe('./stats/requests_full_history/csv'); }); test('does not render a link to download stats history CSV when disabled', () => { @@ -60,7 +60,7 @@ describe('Reports', () => { const link = getByText('Download Report'); expect(link).toBeTruthy(); - expect(link.getAttribute('href')).toBe('/stats/report?theme=dark'); + expect(link.getAttribute('href')).toBe('./stats/report?theme=dark'); }); test('renders a link to download the report in light mode when theme is light', () => { @@ -71,7 +71,7 @@ describe('Reports', () => { const link = getByText('Download Report'); expect(link).toBeTruthy(); - expect(link.getAttribute('href')).toBe('/stats/report?theme=light'); + expect(link.getAttribute('href')).toBe('./stats/report?theme=light'); }); test('renders links to download extended CSV files', () => { diff --git a/locust/webui/src/components/Reports/Reports.tsx b/locust/webui/src/components/Reports/Reports.tsx index be991b2d64..e747d21857 100644 --- a/locust/webui/src/components/Reports/Reports.tsx +++ b/locust/webui/src/components/Reports/Reports.tsx @@ -15,24 +15,24 @@ function Reports({ return ( - Download requests CSV + Download requests CSV {statsHistoryEnabled && ( - + Download full request statistics history CSV )} - Download failures CSV + Download failures CSV - Download exceptions CSV + Download exceptions CSV Download Report