Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show Reset Button when Test is Stopped #2726

Merged
merged 2 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion locust/webui/dist/auth.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />

<title>Locust</title>
<script type="module" crossorigin src="./assets/index-8515c9b5.js"></script>
<script type="module" crossorigin src="./assets/index-e569e7ff.js"></script>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion locust/webui/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />

<title>Locust</title>
<script type="module" crossorigin src="./assets/index-8515c9b5.js"></script>
<script type="module" crossorigin src="./assets/index-e569e7ff.js"></script>
</head>
<body>
<div id="root"></div>
Expand Down
14 changes: 9 additions & 5 deletions locust/webui/src/components/StateButtons/StateButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ export default function StateButtons() {
return null;
}

return swarmState === SWARM_STATE.STOPPED ? (
<NewTestButton />
) : (
return (
<Box sx={{ display: 'flex', columnGap: 2 }}>
<EditButton />
<StopButton />
{swarmState === SWARM_STATE.STOPPED ? (
<NewTestButton />
) : (
<>
<EditButton />
<StopButton />
</>
)}
<ResetButton />
</Box>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ describe('StateButtons', () => {
});

expect(queryByText('New')).toBeTruthy();
expect(queryByText('Reset')).toBeTruthy();
expect(queryByText('Edit')).toBeFalsy();
expect(queryByText('Stop')).toBeFalsy();
expect(queryByText('Reset')).toBeFalsy();
});

test('renders EditButton, StopButton, and ResetButton when swarm state is RUNNING', () => {
Expand Down
Loading