Commit d194f3dc authored by Phil Hughes's avatar Phil Hughes

Merge branch 'himkp-jest-filtered-search' into 'master'

Migrate some filtered_search specs to Jest

See merge request gitlab-org/gitlab!32455
parents 2f8ee6f8 91db0aef
import Vue from 'vue';
import RecentSearchesRoot from '~/filtered_search/recent_searches_root';
jest.mock('vue');
describe('RecentSearchesRoot', () => {
describe('render', () => {
let recentSearchesRoot;
let data;
let template;
let VueSpy;
beforeEach(() => {
recentSearchesRoot = {
......@@ -14,7 +16,7 @@ describe('RecentSearchesRoot', () => {
},
};
VueSpy = spyOnDependency(RecentSearchesRoot, 'Vue').and.callFake(options => {
Vue.mockImplementation(options => {
({ data, template } = options);
});
......@@ -22,7 +24,7 @@ describe('RecentSearchesRoot', () => {
});
it('should instantiate Vue', () => {
expect(VueSpy).toHaveBeenCalled();
expect(Vue).toHaveBeenCalled();
expect(data()).toBe(recentSearchesRoot.store.state);
expect(template).toContain(':is-local-storage-available="isLocalStorageAvailable"');
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment