From 5af6b04b28982de3f58cd8577222345d33f4d79d Mon Sep 17 00:00:00 2001 From: Ayush Sharma Date: Wed, 6 Feb 2019 23:45:48 +0100 Subject: [PATCH] refactor: fixes unit tests for component --- .../unit/webui/components/__snapshots__/noitems.spec.js.snap | 2 +- test/unit/webui/components/noitems.spec.js | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/test/unit/webui/components/__snapshots__/noitems.spec.js.snap b/test/unit/webui/components/__snapshots__/noitems.spec.js.snap index 633d76644..c166e3b12 100644 --- a/test/unit/webui/components/__snapshots__/noitems.spec.js.snap +++ b/test/unit/webui/components/__snapshots__/noitems.spec.js.snap @@ -2,4 +2,4 @@ exports[` component should load the component in default state 1`] = `"
"`; -exports[` component should set html from props 1`] = `"

This is a test string

"`; +exports[` component should set html from props 1`] = `"
This is a test string
"`; diff --git a/test/unit/webui/components/noitems.spec.js b/test/unit/webui/components/noitems.spec.js index 1f8b8f829..f327ad062 100644 --- a/test/unit/webui/components/noitems.spec.js +++ b/test/unit/webui/components/noitems.spec.js @@ -10,7 +10,7 @@ console.error = jest.fn(); describe(' component', () => { test('should load the component in default state', () => { - const wrapper = mount(); + const wrapper = shallow(); expect(wrapper.html()).toMatchSnapshot(); }); @@ -18,8 +18,7 @@ describe(' component', () => { const props = { text: 'This is a test string' }; - const wrapper = shallow(); - expect(wrapper.find('h2').text()).toEqual('This is a test string'); + const wrapper = mount(); expect(wrapper.html()).toMatchSnapshot(); }); });