diff --git a/src/components/EntryList.test.js b/src/components/EntryList.test.js index 0eb1e76..9a8d9d2 100644 --- a/src/components/EntryList.test.js +++ b/src/components/EntryList.test.js @@ -1,8 +1,17 @@ import React from 'react'; import EntryList from './EntryList'; +import { Text } from 'react-native'; +import { ListItem } from 'react-native-elements'; describe('EntryList component', () => { - it('should render as expected', () => { + it('should render CTA if there are no entries yet', () => { + const wrapper = shallow( {}} />); + expect(wrapper.find(Text).length).toEqual(2); + expect(wrapper.find(ListItem).length).toEqual(0); + expect(wrapper).toMatchSnapshot(); + }); + + it('should render entries if there are any', () => { const sampleEntries = [ ['md391', { name: 'Bank 1' }], ['krni8', { name: 'Bank 2' }], @@ -11,6 +20,7 @@ describe('EntryList component', () => { const wrapper = shallow( {}} /> ); + expect(wrapper.find(ListItem).length).toEqual(3); expect(wrapper).toMatchSnapshot(); }); }); diff --git a/src/components/__snapshots__/EntryList.test.js.snap b/src/components/__snapshots__/EntryList.test.js.snap index 14ff6cd..d156279 100644 --- a/src/components/__snapshots__/EntryList.test.js.snap +++ b/src/components/__snapshots__/EntryList.test.js.snap @@ -1,6 +1,44 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`EntryList component should render as expected 1`] = ` +exports[`EntryList component should render CTA if there are no entries yet 1`] = ` + + + + Hmm, Looks like you have no entries yet. + + + Hit the add button below to get started! + + + +`; + +exports[`EntryList component should render entries if there are any 1`] = `