Commit 12bf2a7d authored by Lukas Eipert's avatar Lukas Eipert

Make sure window.gl is properly instantiated in tests

parent 862123d8
......@@ -9,6 +9,8 @@ describe('GLForm', () => {
describe('when instantiated', () => {
beforeEach(done => {
window.gl = window.gl || {};
testContext.form = $('<form class="gfm-form"><textarea class="js-gfm-input"></form>');
testContext.textarea = testContext.form.find('textarea');
jest.spyOn($.prototype, 'off').mockReturnValue(testContext.textarea);
......
......@@ -113,6 +113,7 @@ describe('Search autocomplete dropdown', () => {
window.gon = {};
window.gon.current_user_id = userId;
window.gon.current_username = userName;
window.gl = window.gl || (window.gl = {});
return (widget = initSearchAutocomplete({ autocompletePath }));
});
......
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