Skip to content

Commit

Permalink
adjusted toasts
Browse files Browse the repository at this point in the history
  • Loading branch information
carellamartina committed Dec 14, 2023
1 parent 544eb05 commit 3adb21b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 5 additions & 5 deletions frontend/src/stores/usePluginConfigurationStore.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,23 +198,23 @@ export const usePluginConfigurationStore = create((set, get) => ({
console.debug(resp);
if (resp.data?.status)
addToast(
"Health check status: success",
`${PluginName} is up and running`,
`${PluginName} - health check: success`,
"It is up and running",
"success",
true,
);
else
addToast(
"Health check status: warning",
`${PluginName} is NOT up`,
`${PluginName} - health check: warning`,
"It is NOT up",
"warning",
true,
);
return Promise.resolve(resp.status);
} catch (e) {
console.error(e);
addToast(
"Health check status: failed",
`${PluginName} - health check: failed`,
prettifyErrors(e),
"danger",
true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,15 @@ describe("PluginHealthCheckButton test", () => {
);
// toast
if (responseData.data.status) {
// status: true
expect(
screen.getByText(`${pluginName} is up and running`),
screen.getByText(`${pluginName} - health check: success`),
).toBeInTheDocument();
} else {
expect(screen.getByText(`${pluginName} is NOT up`)).toBeInTheDocument();
// status: false
expect(
screen.getByText(`${pluginName} - health check: warning`),
).toBeInTheDocument();
}
});
});
Expand Down

0 comments on commit 3adb21b

Please sign in to comment.