Commit 2955e956 authored by Winnie Hellmann's avatar Winnie Hellmann Committed by Phil Hughes

Clean up Vue warnings in tests

parent 50d4050d
......@@ -14,6 +14,7 @@ describe('Deploy keys key', () => {
propsData: {
deployKey,
store,
endpoint: 'https://test.host/dummy/endpoint',
},
}).$mount();
};
......
......@@ -17,6 +17,7 @@ describe('Deploy keys panel', () => {
keys: data.enabled_keys,
showHelpBox: true,
store,
endpoint: 'https://test.host/dummy/endpoint',
},
}).$mount();
......
......@@ -4,6 +4,10 @@ import '~/filtered_search/filtered_search_tokenizer';
import '~/filtered_search/filtered_search_dropdown_manager';
describe('Filtered Search Dropdown Manager', () => {
beforeEach(() => {
spyOn(jQuery, 'ajax');
});
describe('addWordToInput', () => {
function getInputValue() {
return document.querySelector('.filtered-search').value;
......
import * as recentSearchesStoreSrc from '~/filtered_search/stores/recent_searches_store';
import RecentSearchesService from '~/filtered_search/services/recent_searches_service';
import RecentSearchesServiceError from '~/filtered_search/services/recent_searches_service_error';
import RecentSearchesRoot from '~/filtered_search/recent_searches_root';
import '~/lib/utils/url_utility';
import '~/lib/utils/common_utils';
import '~/filtered_search/filtered_search_token_keys';
......@@ -71,6 +72,7 @@ describe('Filtered Search Manager', () => {
beforeEach(() => {
spyOn(RecentSearchesService, 'isAvailable').and.returnValue(isLocalStorageAvailable);
spyOn(recentSearchesStoreSrc, 'default');
spyOn(RecentSearchesRoot.prototype, 'render');
filteredSearchManager = new gl.FilteredSearchManager();
filteredSearchManager.setup();
......
......@@ -51,7 +51,6 @@ describe('Issuable output', () => {
});
afterEach(() => {
Vue.http.interceptors = _.without(Vue.http.interceptors, issueShowInterceptor);
});
it('should render a title/description/edited and update title/description/edited on update', (done) => {
......
/* eslint-disable jasmine/no-global-setup */
import $ from 'jquery';
import _ from 'underscore';
import 'jasmine-jquery';
import '~/commons';
import Vue from 'vue';
import VueResource from 'vue-resource';
Vue.use(VueResource);
// enable test fixtures
jasmine.getFixtures().fixturesPath = '/base/spec/javascripts/fixtures';
jasmine.getJSONFixtures().fixturesPath = '/base/spec/javascripts/fixtures';
......@@ -22,7 +28,25 @@ window.gon = window.gon || {};
// enough for the socket to continue to communicate.
// The downside is that it creates a minor performance penalty in the time it takes
// to run our unit tests.
beforeEach(done => done()); // eslint-disable-line jasmine/no-global-setup
beforeEach(done => done());
beforeAll(() => {
const origError = console.error;
spyOn(console, 'error').and.callFake((message) => {
if (/^\[Vue warn\]/.test(message)) {
fail(message);
} else {
origError(message);
}
});
});
const builtinVueHttpInterceptors = Vue.http.interceptors.slice();
beforeEach(() => {
// restore interceptors so we have no remaining ones from previous tests
Vue.http.interceptors = builtinVueHttpInterceptors.slice();
});
// render all of our tests
const testsContext = require.context('.', true, /_spec$/);
......
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