Commit c3dcbbc6 authored by JC Brand's avatar JC Brand

Fix last failing tests.

parent f0091c9c
...@@ -515,15 +515,10 @@ ...@@ -515,15 +515,10 @@
expect($count.html()).toBe('2'); expect($count.html()).toBe('2');
trimmedview.$el.find('.restore-chat').click(); trimmedview.$el.find('.restore-chat').click();
}, converse)); }, converse));
waits(50); waits(250);
runs($.proxy(function () { runs($.proxy(function () {
var trimmed_chatboxes = this.minimized_chats; var trimmed_chatboxes = this.minimized_chats;
var trimmedview = trimmed_chatboxes.get(contact_jid); expect(trimmed_chatboxes.keys().length).toBe(0);
var $count = trimmedview.$el.find('.chat-head-message-count');
expect(trimmedview.model.get('minimized')).toBeFalsy();
expect($count.is(':visible')).toBeFalsy();
expect($count.data('count')).toBeFalsy();
expect($count.html()).toBe('0');
}, converse)); }, converse));
}, converse)); }, converse));
......
...@@ -141,8 +141,7 @@ ...@@ -141,8 +141,7 @@
it("can be minimized by clicking a DOM element with class 'toggle-chatbox-button'", function () { it("can be minimized by clicking a DOM element with class 'toggle-chatbox-button'", function () {
var view = this.chatboxviews.get('lounge@muc.localhost'), var view = this.chatboxviews.get('lounge@muc.localhost'),
trimmed_chatboxes = this.chatboxviews.trimmed_chatboxes_view; trimmed_chatboxes = this.minimized_chats;
spyOn(view, 'minimize').andCallThrough(); spyOn(view, 'minimize').andCallThrough();
spyOn(view, 'maximize').andCallThrough(); spyOn(view, 'maximize').andCallThrough();
spyOn(converse, 'emit'); spyOn(converse, 'emit');
...@@ -158,11 +157,10 @@ ...@@ -158,11 +157,10 @@
expect(view.$el.is(':visible')).toBeFalsy(); expect(view.$el.is(':visible')).toBeFalsy();
expect(view.model.get('minimized')).toBeTruthy(); expect(view.model.get('minimized')).toBeTruthy();
expect(view.minimize).toHaveBeenCalled(); expect(view.minimize).toHaveBeenCalled();
trimmedview = trimmed_chatboxes.get(view.model.get('id')); trimmedview = trimmed_chatboxes.get(view.model.get('id'));
trimmedview.$("a.restore-chat").click(); trimmedview.$("a.restore-chat").click();
}); });
waits(50); waits(250);
runs(function () { runs(function () {
expect(view.maximize).toHaveBeenCalled(); expect(view.maximize).toHaveBeenCalled();
expect(converse.emit).toHaveBeenCalledWith('onChatBoxMaximized', jasmine.any(Object)); expect(converse.emit).toHaveBeenCalledWith('onChatBoxMaximized', jasmine.any(Object));
......
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