Skip to content

Commit

Permalink
Frontend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbaldwin44 committed Jul 16, 2024
1 parent 4e583ff commit 1804212
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
8 changes: 0 additions & 8 deletions locust/webui/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,4 @@ describe('App', () => {

(vi.mocked(authConstants) as any).authArgs = undefined;
});

it('renders the HTML Report when isReport is true', () => {
vi.mocked(swarmConstants).htmlReportProps = swarmReportMock;

const { getByText } = renderWithProvider(<App />);

expect(getByText('Locust Test Report')).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest';

import App from 'App';
import FallbackRender from 'components/FallbackRender/FallbackRender';
import * as swarmConstants from 'constants/swarm';
import * as authConstants from 'constants/auth';
import { renderWithProvider } from 'test/testUtils';

describe('Fallback', () => {
Expand All @@ -24,7 +24,7 @@ describe('Fallback', () => {

it('renders the FallbackRender when something unexpected happens', () => {
// break the app
(vi.mocked(swarmConstants) as any).htmlReportProps = {};
(vi.mocked(authConstants) as any).authArgs = { authProviders: {} };

const { getByText } = renderWithProvider(
<ErrorBoundary fallbackRender={FallbackRender}>
Expand Down
3 changes: 2 additions & 1 deletion locust/webui/src/pages/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Alert, Box, Button, IconButton, TextField, Typography } from '@mui/mate
import CssBaseline from '@mui/material/CssBaseline';
import { ThemeProvider } from '@mui/material/styles';

import Logo from 'assets/logo.png';
import DarkLightToggle from 'components/Layout/Navbar/DarkLightToggle';
import { THEME_MODE } from 'constants/theme';
import { useSelector } from 'redux/hooks';
Expand Down Expand Up @@ -41,7 +42,7 @@ export default function Auth({ authProviders, error, usernamePasswordCallback }:
}}
>
<Box sx={{ display: 'flex', justifyContent: 'center', columnGap: 2 }}>
<img height='52' src='./assets/logo.png' width='52' />
<img height='52' src={Logo} width='52' />
<Typography
component='h1'
noWrap
Expand Down

0 comments on commit 1804212

Please sign in to comment.