Skip to content
Snippets Groups Projects
Verified Commit fe176645 authored by Maciej Lenartowicz's avatar Maciej Lenartowicz
Browse files

Adjusted unit tests to alert context changes

parent e625b4f0
1 merge request!35Move alert to portal
Pipeline #55460 passed with stages
in 3 minutes and 57 seconds
......@@ -12,8 +12,10 @@ import { useAlert, AlertContextProvider } from "../AlertContext";
function AlertTest() {
const [setAlert, dismissAlert] = useAlert();
// alert-container serves as an output for Portal which renders Alert
return (
<>
<div id="alert-container" />
<button onClick={() => setAlert("Alert content")}>Set alert</button>
<button onClick={dismissAlert}>Dismiss alert</button>
</>
......
......@@ -3,15 +3,19 @@
exports[`AlertContext should render alert 1`] = `
<div>
<div
class="alert alert-dismissible alert-danger fixed-top floating-alert"
id="alert-container"
>
<button
class="close"
type="button"
<div
class="alert alert-dismissible alert-danger"
>
×
</button>
Alert content
<button
class="close"
type="button"
>
×
</button>
Alert content
</div>
</div>
<button>
Set alert
......@@ -24,6 +28,9 @@ exports[`AlertContext should render alert 1`] = `
exports[`AlertContext should render component without alert 1`] = `
<div>
<div
id="alert-container"
/>
<button>
Set alert
</button>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment