Commit 6c262f72 authored by JC Brand's avatar JC Brand

Various small changes to reduce (non-critical) errors during testing

parent b0c20d54
...@@ -321,7 +321,10 @@ ...@@ -321,7 +321,10 @@
}); });
describe("The \"settings\" API", function() { describe("The \"settings\" API", function() {
it("has methods 'get' and 'set' to set configuration settings", mock.initConverse(function (_converse) { it("has methods 'get' and 'set' to set configuration settings", mock.initConverse(
{'play_sounds': true},
function (_converse) {
expect(_.keys(_converse.api.settings)).toEqual(["get", "set"]); expect(_.keys(_converse.api.settings)).toEqual(["get", "set"]);
expect(_converse.api.settings.get("play_sounds")).toBe(true); expect(_converse.api.settings.get("play_sounds")).toBe(true);
_converse.api.settings.set("play_sounds", false); _converse.api.settings.set("play_sounds", false);
......
...@@ -150,7 +150,11 @@ ...@@ -150,7 +150,11 @@
var _converse = this.__super__._converse; var _converse = this.__super__._converse;
if (ev && ev.preventDefault) { ev.preventDefault(); } if (ev && ev.preventDefault) { ev.preventDefault(); }
// save the scroll position to restore it on maximize // save the scroll position to restore it on maximize
this.model.save({'scroll': this.$content.scrollTop()}); if (this.model.collection && this.model.collection.browserStorage) {
this.model.save({'scroll': this.$content.scrollTop()});
} else {
this.model.set({'scroll': this.$content.scrollTop()});
}
this.setChatState(_converse.INACTIVE).model.minimize(); this.setChatState(_converse.INACTIVE).model.minimize();
this.hide(); this.hide();
_converse.emit('chatBoxMinimized', this); _converse.emit('chatBoxMinimized', this);
......
...@@ -548,7 +548,7 @@ ...@@ -548,7 +548,7 @@
* *
* This is instead done in `afterConnected` below. * This is instead done in `afterConnected` below.
*/ */
if (this.model.collection.browserStorage) { if (this.model.collection && this.model.collection.browserStorage) {
// Without a connection, we haven't yet initialized // Without a connection, we haven't yet initialized
// localstorage // localstorage
this.model.save(); this.model.save();
......
...@@ -90,6 +90,7 @@ ...@@ -90,6 +90,7 @@
var converse = converse_api.initialize(_.extend({ var converse = converse_api.initialize(_.extend({
'i18n': 'en', 'i18n': 'en',
'auto_subscribe': false, 'auto_subscribe': false,
'play_sounds': false,
'bosh_service_url': 'localhost', 'bosh_service_url': 'localhost',
'connection': connection, 'connection': connection,
'animate': false, 'animate': false,
......
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