Skip to content

Commit

Permalink
Upgrade jQuery to 1.12.1 and fetch from node_modules.
Browse files Browse the repository at this point in the history
Fixes: #1196.
  • Loading branch information
Brock Whittaker authored and timabbott committed Aug 25, 2016
1 parent 3ba604c commit 8f73701
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 9,412 deletions.
4 changes: 3 additions & 1 deletion frontend_tests/node_tests/i18n.js
Expand Up @@ -23,7 +23,9 @@ i18n.init({
}
});

global.$ = require('jQuery');
var jsdom = require("jsdom");
var window = jsdom.jsdom().defaultView;
global.$ = require('jquery')(window);
var _ = global._;

// When writing these tests, the following command might be helpful:
Expand Down
2 changes: 1 addition & 1 deletion frontend_tests/node_tests/message_list_view.js
Expand Up @@ -2,7 +2,7 @@ var _ = require('third/underscore/underscore.js');
var MessageListView = require('js/message_list_view.js');

add_dependencies({
$: 'jQuery',
$: 'jquery',
XDate: 'third/xdate/xdate.dev.js',
util: 'js/util.js'
});
Expand Down
4 changes: 3 additions & 1 deletion frontend_tests/node_tests/presence_list_performance.js
Expand Up @@ -27,7 +27,9 @@ compose_fade.update_faded_users = function () {
return;
};

global.$ = require('jQuery');
var jsdom = require("jsdom");
var window = jsdom.jsdom().defaultView;
global.$ = require('jquery')(window);
$.fn.expectOne = function () {
assert(this.length === 1);
return this;
Expand Down
6 changes: 4 additions & 2 deletions frontend_tests/node_tests/stream_list.js
Expand Up @@ -20,7 +20,9 @@ set_global('message_store', {

var stream_list = require('js/stream_list.js');

global.$ = require('jQuery');
var jsdom = require("jsdom");
var window = jsdom.jsdom().defaultView;
global.$ = require('jquery')(window);
$.fn.expectOne = function () {
assert(this.length === 1);
return this;
Expand Down Expand Up @@ -107,7 +109,7 @@ global.use_template('stream_privacy');

var li = stream_list.get_stream_li('social');
assert.equal(li.attr('data-name'), 'social');
assert.equal(li.find('.streamlist_swatch').css('background-color'), 'green');
assert.equal(li.find('.streamlist_swatch').attr('style'), 'background-color: green');
assert.equal(li.find('a.subscription_name').text().trim(), 'social');
assert(li.find('.arrow').find("i").hasClass("icon-vector-chevron-down"));

Expand Down
5 changes: 4 additions & 1 deletion frontend_tests/node_tests/templates.js
Expand Up @@ -15,7 +15,9 @@ i18n.init({
lng: 'en'
});

global.$ = require('jQuery');
var jsdom = require("jsdom");
var window = jsdom.jsdom().defaultView;
global.$ = require('jquery')(window);
var _ = global._;

// When writing these tests, the following command might be helpful:
Expand Down Expand Up @@ -455,6 +457,7 @@ function render(template_name, args) {
var html = render('message_info_popover_title', args);
global.write_handlebars_output("message_info_popover_title", html);

html = '<div>' + html + '</div>';
assert($(html).text().trim(), "Message to stream devel");
}());

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -11,12 +11,12 @@
"i18next-xhr-backend": "0.5.4",
"i18next-browser-languagedetector": "0.3.0",
"i18next-localstorage-cache": "0.3.0",
"jquery": "1.12.1",
"jquery-validation": "1.15.1",
"webpack": "1.12.2"
},
"devDependencies": {
"istanbul": "0.4.0",
"jQuery": "1.7.4",
"jsdom": "0.5.7",
"xmlhttprequest": "1.5.0",
"nwmatcher": "1.3.6",
Expand Down

0 comments on commit 8f73701

Please sign in to comment.