gitlab-org--gitlab-foss/spec/frontend/filtered_search/recent_searches_root_spec.js

33 lines
778 B
JavaScript
Raw Normal View History

import Vue from 'vue';
2017-05-05 17:59:41 +00:00
import RecentSearchesRoot from '~/filtered_search/recent_searches_root';
jest.mock('vue');
2017-05-05 17:59:41 +00:00
describe('RecentSearchesRoot', () => {
describe('render', () => {
let recentSearchesRoot;
let data;
let template;
beforeEach(() => {
recentSearchesRoot = {
store: {
state: 'state',
},
};
Vue.mockImplementation(options => {
({ data, template } = options);
2017-05-05 17:59:41 +00:00
});
RecentSearchesRoot.prototype.render.call(recentSearchesRoot);
});
it('should instantiate Vue', () => {
expect(Vue).toHaveBeenCalled();
2017-05-05 17:59:41 +00:00
expect(data()).toBe(recentSearchesRoot.store.state);
expect(template).toContain(':is-local-storage-available="isLocalStorageAvailable"');
});
});
});