diff --git a/css/converse.css b/css/converse.css index fc6a19939..b66ce0e5a 100644 --- a/css/converse.css +++ b/css/converse.css @@ -610,6 +610,10 @@ span.spinner.hor_centered { width: 99px; border-bottom: 1px solid #999; } +#conversejs .participants label { + margin-top: 5px; + display: block; +} #conversejs .participants ul.participant-list li { overflow: hidden; text-overflow: ellipsis; diff --git a/less/converse.less b/less/converse.less index 42240d45a..ecce0ea59 100644 --- a/less/converse.less +++ b/less/converse.less @@ -661,6 +661,11 @@ span.spinner.hor_centered { border-bottom: 1px solid #999; } +#conversejs .participants label { + margin-top: 5px; + display: block; +} + #conversejs .participants ul.participant-list li { overflow: hidden; text-overflow: ellipsis; diff --git a/spec/chatroom.js b/spec/chatroom.js index 436a82cb9..c57075bce 100644 --- a/spec/chatroom.js +++ b/spec/chatroom.js @@ -12,16 +12,13 @@ beforeEach(function () { runs(function () { test_utils.closeAllChatBoxes(); - }); - waits(250); - runs(function () { test_utils.openControlBox(); }); - waits(250); + waits(150); runs(function () { test_utils.openRoomsPanel(); }); - waits(501); + waits(200); runs(function () { // Open a new chatroom var roomspanel = converse.chatboxviews.get('controlbox').roomspanel; @@ -37,7 +34,6 @@ runs(function () { test_utils.closeControlBox(); }); - waits(250); runs(function () {}); }); @@ -70,6 +66,32 @@ }, converse)); it("allows the user to invite their roster contacts to enter the chat room", $.proxy(function () { + spyOn(converse, 'emit'); + spyOn(window, 'prompt').andCallFake(function () { + return null; + }); + var roster = {}, $input; + var view = this.chatboxviews.get('lounge@muc.localhost'); + view.$el.find('.chat-area').remove(); + view.renderChatArea(); // Will init the widget + test_utils.createContacts('current'); // We need roster contacts, so that we have someone to invite + $input = view.$el.find('input.invited-contact.tt-input'); + $hint = view.$el.find('input.invited-contact.tt-hint'); + runs (function () { + expect($input.length).toBe(1); + expect($input.attr('placeholder')).toBe('Type to invite'); + $input.val("Felix"); + $input.trigger('input'); + }); + waits(350); // Needed, due to debounce + runs (function () { + expect($input.val()).toBe('Felix'); + expect($hint.val()).toBe('Felix Amsel'); + var $sugg = view.$el.find('[data-jid="felix.amsel@localhost"]'); + expect($sugg.length).toBe(1); + $sugg.trigger('click'); + expect(window.prompt).toHaveBeenCalled(); + }); }, converse)); it("shows received groupchat messages", $.proxy(function () {