UNPKG

symphony-integration-commons

Version:

Common components for 3rd party developers build the user facing application for Symphony Integrations.

38 lines (31 loc) 1.18 kB
import React from 'react'; import { shallow, mount } from 'enzyme'; import assert from 'assert'; import SuggestionsRooms from '../components/PostingLocation/SuggestionsRooms/SuggestionsRooms.jsx'; function setup() { const props = { userRooms: [], fetchUserRooms: () => { return []; }, loading: true, addStreamToInstance: () => { return {}; }, removeStreamFromInstance: () => { return {}; }, resetPostingLocation: () => { return {}; }, }; const enzymeWrapper = shallow(<SuggestionsRooms {...props} />); return { props, enzymeWrapper, }; } describe('Testing SuggestionsRooms component', () => { it ('Expect input search placeholder to be equal "Loading...", when loading prop is true:', () => { const { enzymeWrapper } = setup(); expect(enzymeWrapper.find('input').props().placeholder).toEqual('Loading...'); }); it ('Expect input search placeholder to be equal "Search rooms" when loading prop is false:', () => { const { props } = setup(); props.loading = false; const wrapper = shallow(<SuggestionsRooms {...props} />); expect(wrapper.find('input').props().placeholder).toEqual('Search rooms'); }); });