Commit 18565e79 authored by JC Brand's avatar JC Brand

Remove trailing whitespace

parent 1c95e473
(function (root, factory) { (function (root, factory) {
define("mock", define("mock",
['converse'], ['converse'],
function() { function() {
return factory(); return factory();
}); });
}(this, function (converse) { }(this, function (converse) {
var mock_connection = { var mock_connection = {
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
'rooms': {} 'rooms': {}
}, },
'jid': 'dummy@localhost', 'jid': 'dummy@localhost',
'addHandler': function (handler, ns, name, type, id, from, options) { 'addHandler': function (handler, ns, name, type, id, from, options) {
return function () {}; return function () {};
}, },
'send': function () {}, 'send': function () {},
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
'subscribe': function () {}, 'subscribe': function () {},
'registerCallback': function () {} 'registerCallback': function () {}
}, },
'vcard': { 'vcard': {
'get': function (callback, jid) { 'get': function (callback, jid) {
var firstname, lastname; var firstname, lastname;
if (!jid) { if (!jid) {
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
var fullname = firstname+' '+lastname; var fullname = firstname+' '+lastname;
var vcard = $iq().c('vCard').c('FN').t(fullname); var vcard = $iq().c('vCard').c('FN').t(fullname);
callback(vcard.tree()); callback(vcard.tree());
} }
}, },
'disco': { 'disco': {
'info': function () {}, 'info': function () {},
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
expect($("div#controlbox").is(':visible')).toBe(true); expect($("div#controlbox").is(':visible')).toBe(true);
}, converse); }, converse);
it("can be opened by clicking a DOM element with class 'toggle-online-users'", open_controlbox); it("can be opened by clicking a DOM element with class 'toggle-online-users'", open_controlbox);
describe("The Status Widget", $.proxy(function () { describe("The Status Widget", $.proxy(function () {
it("can be used to set the current user's chat status", $.proxy(function () { it("can be used to set the current user's chat status", $.proxy(function () {
var view = this.xmppstatusview; var view = this.xmppstatusview;
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
var i, t, is_last; var i, t, is_last;
spyOn(this.rosterview, 'render').andCallThrough(); spyOn(this.rosterview, 'render').andCallThrough();
for (i=0; i<pend_names.length; i++) { for (i=0; i<pend_names.length; i++) {
is_last = i==(pend_names.length-1); is_last = i===(pend_names.length-1);
this.roster.create({ this.roster.create({
jid: pend_names[i].replace(' ','.').toLowerCase() + '@localhost', jid: pend_names[i].replace(' ','.').toLowerCase() + '@localhost',
subscription: 'none', subscription: 'none',
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
fullname: pend_names[i], fullname: pend_names[i],
is_last: is_last is_last: is_last
}); });
// For performance reasons, the roster should only be shown once // For performance reasons, the roster should only be shown once
// the last contact has been added. // the last contact has been added.
if (is_last) { if (is_last) {
expect(this.rosterview.$el.is(':visible')).toEqual(true); expect(this.rosterview.$el.is(':visible')).toEqual(true);
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
subscription: 'both', subscription: 'both',
ask: null, ask: null,
fullname: cur_names[i], fullname: cur_names[i],
is_last: i==(cur_names.length-1) is_last: i===(cur_names.length-1)
}); });
expect(this.rosterview.render).toHaveBeenCalled(); expect(this.rosterview.render).toHaveBeenCalled();
// Check that they are sorted alphabetically // Check that they are sorted alphabetically
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
subscription: 'none', subscription: 'none',
ask: 'request', ask: 'request',
fullname: req_names[i], fullname: req_names[i],
is_last: i==(req_names.length-1) is_last: i===(req_names.length-1)
}); });
expect(this.rosterview.render).toHaveBeenCalled(); expect(this.rosterview.render).toHaveBeenCalled();
// Check that they are sorted alphabetically // Check that they are sorted alphabetically
...@@ -335,7 +335,7 @@ ...@@ -335,7 +335,7 @@
expect(this.rosterview.removeRosterItem).toHaveBeenCalled(); expect(this.rosterview.removeRosterItem).toHaveBeenCalled();
expect(this.connection.roster.unauthorize).toHaveBeenCalled(); expect(this.connection.roster.unauthorize).toHaveBeenCalled();
// There should now be one less contact // There should now be one less contact
expect(this.roster.length).toEqual(num_contacts-1); expect(this.roster.length).toEqual(num_contacts-1);
}, converse)); }, converse));
}, converse)); }, converse));
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
afterEach($.proxy(function () { afterEach($.proxy(function () {
// Contacts retrieved from localStorage have chat_status of // Contacts retrieved from localStorage have chat_status of
// "offline". // "offline".
// In the next test suite, we need some online contacts, so // In the next test suite, we need some online contacts, so
// we make some online now // we make some online now
for (i=0; i<5; i++) { for (i=0; i<5; i++) {
...@@ -456,7 +456,7 @@ ...@@ -456,7 +456,7 @@
expect(newchatboxes.length).toEqual(0); expect(newchatboxes.length).toEqual(0);
// Lets open the controlbox again, purely for visual feedback // Lets open the controlbox again, purely for visual feedback
open_controlbox(); open_controlbox();
}, converse)); }, converse));
describe("A Chat Message", $.proxy(function () { describe("A Chat Message", $.proxy(function () {
...@@ -465,8 +465,8 @@ ...@@ -465,8 +465,8 @@
var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost'; var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost';
msg = $msg({ msg = $msg({
from: sender_jid, from: sender_jid,
to: this.connection.jid, to: this.connection.jid,
type: 'chat', type: 'chat',
id: (new Date()).getTime() id: (new Date()).getTime()
}).c('body').t(message).up() }).c('body').t(message).up()
.c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree(); .c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree();
...@@ -534,8 +534,8 @@ ...@@ -534,8 +534,8 @@
var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost'; var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost';
msg = $msg({ msg = $msg({
from: sender_jid, from: sender_jid,
to: this.connection.jid, to: this.connection.jid,
type: 'chat', type: 'chat',
id: (new Date()).getTime() id: (new Date()).getTime()
}).c('body').t(message).up() }).c('body').t(message).up()
.c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree(); .c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree();
...@@ -563,8 +563,8 @@ ...@@ -563,8 +563,8 @@
var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost'; var sender_jid = cur_names[0].replace(' ','.').toLowerCase() + '@localhost';
msg = $msg({ msg = $msg({
from: sender_jid, from: sender_jid,
to: this.connection.jid, to: this.connection.jid,
type: 'chat', type: 'chat',
id: (new Date()).getTime() id: (new Date()).getTime()
}).c('body').t(message).up() }).c('body').t(message).up()
.c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree(); .c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree();
......
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