1 import React from 'react';
2 import { mount } from 'enzyme';
3 import {Provider} from 'react-redux'
4 import configureStore from 'redux-mock-store';
6 import GlobalAutoCompleteSearchBar from 'app/globalAutoCompleteSearchBar/GlobalAutoCompleteSearchBar.jsx'
7 import AutoCompleteSearchBar from 'generic-components/autoCompleteSearchBar/AutoCompleteSearchBar.jsx';
9 globalAutoCompleteSearchBarActionTypes
10 } from 'app/globalAutoCompleteSearchBar/GlobalAutoCompleteSearchBarConstants.js';
12 describe('GlobalAutoCompleteSearchBarTests', () => {
13 const initValue = 'some random search text';
14 const initialState = {
15 globalAutoCompleteSearchBarReducer: {
19 const mockStore = configureStore();
23 store = mockStore(initialState);
24 wrapper = mount(<Provider store={store}><GlobalAutoCompleteSearchBar /></Provider>);
27 it('render search bar - visible', () => {
28 expect(wrapper).toHaveLength(1); // ensure the message bar is mounted
29 expect(wrapper.find(AutoCompleteSearchBar)).toHaveLength(1); // ensure the InlineMessage is mounted
32 it('props assigned properly', () => {
33 expect(wrapper.find(AutoCompleteSearchBar).props().value).toEqual(initValue); // check that the props match