From fef0e9d2d0a9e76f2e6e82809204d17e9cd5b341 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Mon, 15 Apr 2019 20:10:28 -0700 Subject: [PATCH] Change ListPage tests to use toExist instead of toHaveLength Signed-off-by: Mcat12 --- src/components/list/__tests__/ListPage.test.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/list/__tests__/ListPage.test.tsx b/src/components/list/__tests__/ListPage.test.tsx index 71528f7..4f1a013 100644 --- a/src/components/list/__tests__/ListPage.test.tsx +++ b/src/components/list/__tests__/ListPage.test.tsx @@ -96,7 +96,7 @@ it("starts with no alerts shown", () => { /> ); - expect(wrapper.find(Alert)).toHaveLength(0); + expect(wrapper.find(Alert)).not.toExist(); }); it("hides the alert if closed", () => { @@ -118,12 +118,12 @@ it("hides the alert if closed", () => { // Now the alert is shown const alert = wrapper.find(Alert); - expect(alert).toHaveLength(1); + expect(alert).toExist(); // Hide the alert alert.props().onClick(); - expect(wrapper.find(Alert)).toHaveLength(0); + expect(wrapper.find(Alert)).not.toExist(); }); it("cancels requests when un-mounting", async () => { @@ -184,7 +184,7 @@ it("shows a validation message as an error", () => { .onValidationError(); const alert = wrapper.find(Alert); - expect(alert).toHaveLength(1); + expect(alert).toExist(); expect(alert.props().message).toEqual(validationError); expect(alert.props().type).toEqual("danger"); });