From 43ab17d5075e1ee57b464551f3c30653ba87f326 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 22 Aug 2017 09:01:53 -0300 Subject: [PATCH] Reduce test lines of code --- __tests__/RoomItem.js | 62 +++---------------------------------------- 1 file changed, 4 insertions(+), 58 deletions(-) diff --git a/__tests__/RoomItem.js b/__tests__/RoomItem.js index 216fdbd0e..72cf039c2 100644 --- a/__tests__/RoomItem.js +++ b/__tests__/RoomItem.js @@ -5,70 +5,16 @@ import RoomItem from '../app/components/RoomItem'; // Note: test renderer must be required after react-native. import renderer from 'react-test-renderer'; -jest.mock('react-native-img-cache', () => { - return { - CachedImage: 'View' - } -}); +jest.mock('react-native-img-cache', () => { return { CachedImage: 'View' } }); it('renders correctly', () => { - const tree = renderer.create( - - ).toJSON(); - expect(tree).toMatchSnapshot(); + expect(renderer.create().toJSON()).toMatchSnapshot(); }); it('render unread', () => { - const tree = renderer.create( - - ).toJSON(); - expect(tree).toMatchSnapshot(); + expect(renderer.create().toJSON()).toMatchSnapshot(); }); it('render unread +999', () => { - const tree = renderer.create( - - ).toJSON(); - expect(tree).toMatchSnapshot(); -}); - -it('render no icon', () => { - const tree = renderer.create( - - ).toJSON(); - expect(tree).toMatchSnapshot(); -}); - -it('render private group', () => { - const tree = renderer.create( - - ).toJSON(); - expect(tree).toMatchSnapshot(); -}); - -it('render channel', () => { - const tree = renderer.create( - - ).toJSON(); - expect(tree).toMatchSnapshot(); + expect(renderer.create().toJSON()).toMatchSnapshot(); });