diff --git a/src/components/alert/__tests__/Alerts.test.tsx b/src/components/alert/__tests__/Alerts.test.tsx
index dcdbd2293f..feb7c67283 100644
--- a/src/components/alert/__tests__/Alerts.test.tsx
+++ b/src/components/alert/__tests__/Alerts.test.tsx
@@ -18,10 +18,12 @@ const WithButton = () => {
);
};
-it("renders global alerts", () => {
+it("renders empty alert panel", () => {
const empty = mount( {}} />);
expect(empty).toMatchSnapshot();
+});
+it("remove alert after timeout", () => {
const tree = mount();
const button = tree.find("button");
expect(button).not.toBeNull();
@@ -29,10 +31,10 @@ it("renders global alerts", () => {
act(() => {
button!.simulate("click");
});
- expect(tree).toMatchSnapshot();
+ expect(tree).toMatchSnapshot("with alert");
act(() => {
jest.runAllTimers();
});
- expect(tree).toMatchSnapshot();
+ expect(tree).toMatchSnapshot("cleared alert");
});
diff --git a/src/components/alert/__tests__/__snapshots__/Alerts.test.tsx.snap b/src/components/alert/__tests__/__snapshots__/Alerts.test.tsx.snap
index 8e9a3fff90..3c6a29ced0 100644
--- a/src/components/alert/__tests__/__snapshots__/Alerts.test.tsx.snap
+++ b/src/components/alert/__tests__/__snapshots__/Alerts.test.tsx.snap
@@ -1,35 +1,54 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`renders global alerts 1`] = `
-
-
+
-
-
-
- }
+
-
+
+
+ }
>
-
-
-
-
-
+
+
+
+
+
+
+
+
`;
-exports[`renders global alerts 2`] = `
+exports[`remove alert after timeout: with alert 1`] = `
`;
-exports[`renders global alerts 3`] = `
-
-
+
-
-
-
-
- }
- >
-
+
-
-
-
-
-
-
+ }
>
- Add
-
-
-
+
+
+
+
+
+
`;