From c3fd413486fe9012a6e845feb2a48b4e76a26221 Mon Sep 17 00:00:00 2001 From: Andrew Baldwin Date: Tue, 20 Aug 2024 07:38:45 -0400 Subject: [PATCH] Replace logo svg --- locust/webui/src/assets/Logo.tsx | 52 +++++++------------ locust/webui/src/pages/Auth.tsx | 2 +- locust/webui/src/pages/tests/Auth.test.tsx | 4 +- .../webui/src/pages/tests/Dashboard.test.tsx | 4 +- 4 files changed, 25 insertions(+), 37 deletions(-) diff --git a/locust/webui/src/assets/Logo.tsx b/locust/webui/src/assets/Logo.tsx index ef181ad97a..f0bc63f3c8 100644 --- a/locust/webui/src/assets/Logo.tsx +++ b/locust/webui/src/assets/Logo.tsx @@ -1,51 +1,39 @@ -import { useTheme } from '@mui/material/styles'; - -import { THEME_MODE } from 'constants/theme'; - -export default function Logo({ lightModeBackgroundColor }: { lightModeBackgroundColor?: string }) { - const theme = useTheme(); - const strokeColor = - theme.palette.mode === THEME_MODE.DARK - ? theme.palette.background.default - : lightModeBackgroundColor || theme.palette.primary.main; - +export default function Logo() { return ( + Locust + - diff --git a/locust/webui/src/pages/Auth.tsx b/locust/webui/src/pages/Auth.tsx index 8ee7b4db1c..eabed20660 100644 --- a/locust/webui/src/pages/Auth.tsx +++ b/locust/webui/src/pages/Auth.tsx @@ -34,7 +34,7 @@ export default function Auth({ authProviders, error, usernamePasswordCallback }: }} > - + {usernamePasswordCallback && (
diff --git a/locust/webui/src/pages/tests/Auth.test.tsx b/locust/webui/src/pages/tests/Auth.test.tsx index 2d0428ce34..b38523f1be 100644 --- a/locust/webui/src/pages/tests/Auth.test.tsx +++ b/locust/webui/src/pages/tests/Auth.test.tsx @@ -59,10 +59,10 @@ describe('Auth', () => { expect(googleLink).toBeTruthy(); expect(googleLink.getAttribute('href')).toEqual(googleProvider.callbackUrl); - expect(icons[1].getAttribute('src')).toEqual(googleProvider.iconUrl); + expect(icons[0].getAttribute('src')).toEqual(googleProvider.iconUrl); expect(githubLink).toBeTruthy(); expect(githubLink.getAttribute('href')).toEqual(githubProvider.callbackUrl); - expect(icons[2].getAttribute('src')).toEqual(githubProvider.iconUrl); + expect(icons[1].getAttribute('src')).toEqual(githubProvider.iconUrl); }); }); diff --git a/locust/webui/src/pages/tests/Dashboard.test.tsx b/locust/webui/src/pages/tests/Dashboard.test.tsx index 2daf70e263..8c95f0108b 100644 --- a/locust/webui/src/pages/tests/Dashboard.test.tsx +++ b/locust/webui/src/pages/tests/Dashboard.test.tsx @@ -7,9 +7,9 @@ import { renderWithProvider } from 'test/testUtils'; describe('Dashboard', () => { test('renders the layout', () => { - const { getByRole } = renderWithProvider(); + const { getByRole, getByTitle } = renderWithProvider(); - const logo = getByRole('img', { name: 'Locust' }); + const logo = getByTitle('Locust'); const heading = getByRole('link', { name: 'Locust' }); expect(heading).toBeTruthy();