diff --git a/mockup/mockup.js b/mockup/mockup.js index 6a3da3942..ed234bd83 100644 --- a/mockup/mockup.js +++ b/mockup/mockup.js @@ -13,15 +13,15 @@ }); it("Show a chat room", function () { - test_utils.openChatRoom('lounge', 'localhost', 'dummy'); - var view = converse.chatboxviews.get('lounge@localhost'); + test_utils.openChatRoom('lounge', 'mongague.lit', 'romeo'); + var view = converse.chatboxviews.get('lounge@mongague.lit'); if (!view.$el.find('.chat-area').length) { view.renderChatArea(); } var text = 'This is a sent message'; view.$el.find('.chat-textarea').text(text); view.$el.find('textarea.chat-textarea').trigger($.Event('keypress', {keyCode: 13})); var message = $msg({ - from: 'lounge@localhost/dummy', - to: 'dummy@localhost.com', + from: 'lounge@mongague.lit/romeo', + to: 'romeo@mongague.lit.com', type: 'groupchat', id: view.model.messages.at(0).get('msgid') }).c('body').t(text); @@ -30,9 +30,9 @@ var nick = mock.chatroom_names[0]; text = 'This is a received message'; message = $msg({ - from: 'lounge@localhost/'+nick, + from: 'lounge@mongague.lit/'+nick, id: '1', - to: 'dummy@localhost', + to: 'romeo@mongague.lit', type: 'groupchat' }).c('body').t(text); view.onChatRoomMessage(message.nodeTree); @@ -49,7 +49,7 @@ $msg({ 'type': 'headline', 'from': 'notify.example.com', - 'to': 'dummy@localhost', + 'to': 'romeo@mongague.lit', 'xml:lang': 'en' }) .c('subject').t('MAIL').up() @@ -59,7 +59,7 @@ }); xit("Show a private chat box", function () { - var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@mongague.lit'; var chatbox = test_utils.openChatBoxFor(contact_jid); var view = converse.chatboxviews.get(contact_jid); var message = 'This message is sent from this chatbox'; diff --git a/spec/autocomplete.js b/spec/autocomplete.js index 9f378cbb2..be4f0b2c7 100644 --- a/spec/autocomplete.js +++ b/spec/autocomplete.js @@ -20,19 +20,19 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'tom'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'tom'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); ['dick', 'harry'].forEach((nick) => { _converse.connection._dataRecv(test_utils.createRequest( $pres({ - 'to': 'tom@localhost/resource', - 'from': `lounge@localhost/${nick}` + 'to': 'tom@montague.lit/resource', + 'from': `lounge@montague.lit/${nick}` }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': `${nick}@localhost/resource`, + 'jid': `${nick}@montague.lit/resource`, 'role': 'participant' }))); }); @@ -62,17 +62,17 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); expect(view.model.occupants.length).toBe(1); let presence = $pres({ - 'to': 'dummy@localhost/resource', - 'from': 'lounge@localhost/some1' + 'to': 'romeo@montague.lit/orchard', + 'from': 'lounge@montague.lit/some1' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'some1@localhost/resource', + 'jid': 'some1@montague.lit/resource', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -109,13 +109,13 @@ expect(view.el.querySelector('.suggestion-box__results').hidden).toBeTruthy(); presence = $pres({ - 'to': 'dummy@localhost/resource', - 'from': 'lounge@localhost/some2' + 'to': 'romeo@montague.lit/orchard', + 'from': 'lounge@montague.lit/some2' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'some2@localhost/resource', + 'jid': 'some2@montague.lit/resource', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -148,13 +148,13 @@ // Test that pressing tab twice selects presence = $pres({ - 'to': 'dummy@localhost/resource', - 'from': 'lounge@localhost/z3r0' + 'to': 'romeo@montague.lit/orchard', + 'from': 'lounge@montague.lit/z3r0' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'z3r0@localhost/resource', + 'jid': 'z3r0@montague.lit/resource', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -173,17 +173,17 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); expect(view.model.occupants.length).toBe(1); const presence = $pres({ - 'to': 'dummy@localhost/resource', - 'from': 'lounge@localhost/some1' + 'to': 'romeo@montague.lit/orchard', + 'from': 'lounge@montague.lit/some1' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'some1@localhost/resource', + 'jid': 'some1@montague.lit/resource', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); diff --git a/spec/bookmarks.js b/spec/bookmarks.js index 24d494cbd..cbabf43a6 100644 --- a/spec/bookmarks.js +++ b/spec/bookmarks.js @@ -96,7 +96,7 @@ await test_utils.waitUntil(() => sent_stanza); expect(sent_stanza.toLocaleString()).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -154,7 +154,7 @@ ['http://jabber.org/protocol/pubsub#publish-options'] ); await test_utils.waitUntil(() => _converse.bookmarks); - let jid = 'lounge@localhost'; + let jid = 'lounge@montague.lit'; _converse.bookmarks.create({ 'jid': jid, 'autojoin': false, @@ -222,8 +222,8 @@ [{'category': 'pubsub', 'type': 'pep'}], ['http://jabber.org/protocol/pubsub#publish-options'] ); - await _converse.api.rooms.open(`lounge@localhost`); - const view = _converse.chatboxviews.get('lounge@localhost'); + await _converse.api.rooms.open(`lounge@montague.lit`); + const view = _converse.chatboxviews.get('lounge@montague.lit'); let bookmark_icon = await test_utils.waitUntil(() => view.el.querySelector('.toggle-bookmark')); expect(_.includes(bookmark_icon.classList, 'button-on')).toBeFalsy(); _converse.bookmarks.create({ @@ -289,7 +289,7 @@ // conferences to bookmark (since we removed the one and // only bookmark). expect(sent_stanza.toLocaleString()).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -389,8 +389,8 @@ * */ var stanza = $msg({ - 'from': 'dummy@localhost', - 'to': 'dummy@localhost/resource', + 'from': 'romeo@montague.lit', + 'to': 'romeo@montague.lit/orchard', 'type': 'headline', 'id': 'rnfoo1' }).c('event', {'xmlns': 'http://jabber.org/protocol/pubsub#event'}) @@ -445,7 +445,7 @@ ); expect(Strophe.serialize(call.args[0])).toBe( - ``+ + ``+ ''+ ''+ ''+ @@ -528,7 +528,7 @@ ).pop() ); expect(Strophe.serialize(call.args[0])).toBe( - ``+ + ``+ ''+ ''+ ''+ @@ -616,7 +616,7 @@ ).pop() ); expect(Strophe.serialize(call.args[0])).toBe( - ``+ + ``+ ''+ ''+ ''+ diff --git a/spec/chatbox.js b/spec/chatbox.js index 358e3a224..c94621ff1 100644 --- a/spec/chatbox.js +++ b/spec/chatbox.js @@ -25,7 +25,7 @@ await test_utils.waitForRoster(_converse, 'current', 1); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.chatboxviews.get(contact_jid); test_utils.sendMessage(view, '/help'); @@ -55,11 +55,11 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - await test_utils.waitUntilDiscoConfirmed(_converse, 'localhost', [], ['vcard-temp']); + await test_utils.waitUntilDiscoConfirmed(_converse, 'montague.lit', [], ['vcard-temp']); await test_utils.waitUntil(() => _converse.xmppstatus.vcard.get('fullname')); await test_utils.openControlBox(); expect(_converse.chatboxes.length).toEqual(1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; let message = '/me is tired'; const msg = $msg({ from: sender_jid, @@ -73,12 +73,12 @@ const view = _converse.chatboxviews.get(sender_jid); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); expect(view.el.querySelectorAll('.chat-msg--action').length).toBe(1); - expect(_.includes(view.el.querySelector('.chat-msg__author').textContent, '**Max Frankfurter')).toBeTruthy(); + expect(_.includes(view.el.querySelector('.chat-msg__author').textContent, '**Mercutio')).toBeTruthy(); expect(view.el.querySelector('.chat-msg__text').textContent).toBe('is tired'); message = '/me is as well'; await test_utils.sendMessage(view, message); expect(view.el.querySelectorAll('.chat-msg--action').length).toBe(2); - await test_utils.waitUntil(() => sizzle('.chat-msg__author:last', view.el).pop().textContent.trim() === '**Max Mustermann'); + await test_utils.waitUntil(() => sizzle('.chat-msg__author:last', view.el).pop().textContent.trim() === '**Romeo Montague'); const last_el = sizzle('.chat-msg__text:last', view.el).pop(); expect(last_el.textContent).toBe('is as well'); expect(u.hasClass('chat-msg--followup', last_el)).toBe(false); @@ -115,7 +115,7 @@ const online_contacts = _converse.rosterview.el.querySelectorAll('.roster-group .current-xmpp-contact a.open-chat'); expect(online_contacts.length).toBe(15); let el = online_contacts[0]; - const jid = el.textContent.trim().replace(/ /g,'.').toLowerCase() + '@localhost'; + const jid = el.textContent.trim().replace(/ /g,'.').toLowerCase() + '@montague.lit'; el.click(); await test_utils.waitUntil(() => _converse.chatboxes.length == 2); const chatboxview = _converse.chatboxviews.get(jid); @@ -126,7 +126,7 @@ online_contacts[1].click(); await test_utils.waitUntil(() => _converse.chatboxes.length == 3); el = online_contacts[1]; - const new_jid = el.textContent.trim().replace(/ /g,'.').toLowerCase() + '@localhost'; + const new_jid = el.textContent.trim().replace(/ /g,'.').toLowerCase() + '@montague.lit'; const new_chatboxview = _converse.chatboxviews.get(new_jid); expect(_converse.chatboxviews.trimChats).toHaveBeenCalled(); // Check that new chat boxes are created to the left of the @@ -140,11 +140,11 @@ async function (done, _converse) { _converse.api.trigger('rosterContactsFetched'); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const stanza = u.toStanza(` + to="romeo@montague.lit/orchard"> Hey\nHave you heard the news? `); @@ -161,11 +161,11 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const stanza = u.toStanza(` + to="romeo@montague.lit/orchard"> `); const message_promise = new Promise(resolve => _converse.api.listen.on('message', resolve)) @@ -209,7 +209,7 @@ for (i=0; i _converse.chatboxes.length > 1); const chatBoxView = _converse.chatboxviews.get(sender_jid); @@ -257,14 +257,14 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; // openControlBox was called earlier, so the controlbox is // visible, but no other chat boxes have been created. expect(_converse.chatboxes.length).toEqual(1); const view = await test_utils.openChatBoxFor(_converse, contact_jid); const el = sizzle('a.open-chat:contains("'+view.model.getDisplayName()+'")', _converse.rosterview.el).pop(); - const jid = el.textContent.replace(/ /g,'.').toLowerCase() + '@localhost'; + const jid = el.textContent.replace(/ /g,'.').toLowerCase() + '@montague.lit'; spyOn(_converse.api, "trigger"); el.click(); await test_utils.waitUntil(() => _converse.api.trigger.calls.count(), 500); @@ -317,7 +317,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[7].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[7].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length); await test_utils.openChatBoxFor(_converse, contact_jid); const controlview = _converse.chatboxviews.get('controlbox'), // The controlbox is currently open @@ -352,7 +352,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[7].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[7].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length); await test_utils.openChatBoxFor(_converse, contact_jid); const trimmed_chatboxes = _converse.minimized_chats; @@ -433,7 +433,7 @@ await test_utils.waitForRoster(_converse, 'current', 3); test_utils.openControlBox(); - const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const chatbox = _converse.chatboxes.get(contact_jid); const view = _converse.chatboxviews.get(contact_jid); @@ -453,7 +453,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.chatboxviews.get(contact_jid); const toolbar = view.el.querySelector('ul.chat-toolbar'); @@ -484,7 +484,7 @@ test_utils.openControlBox(); let toolbar, call_button; - const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; spyOn(_converse.api, "trigger"); // First check that the button doesn't show if it's not enabled // via "visible_toolbar_buttons" @@ -518,12 +518,12 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, sender_jid); let stanza = u.toStanza( ` + to="romeo@montague.lit/orchard"> @@ -533,7 +533,7 @@ stanza = u.toStanza( ` + to="romeo@montague.lit/orchard"> @@ -551,7 +551,7 @@ test_utils.openControlBox(); spyOn(_converse.api, "trigger"); - const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; // state const msg = $msg({ 'from': sender_jid, @@ -573,7 +573,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; test_utils.openControlBox(); test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length); spyOn(_converse.connection, 'send'); @@ -596,7 +596,7 @@ await test_utils.waitForRoster(_converse, 'current', 1); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length); await test_utils.openChatBoxFor(_converse, contact_jid); @@ -630,7 +630,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length); await test_utils.openChatBoxFor(_converse, contact_jid); @@ -672,7 +672,7 @@ // See XEP-0085 https://xmpp.org/extensions/xep-0085.html#definitions spyOn(_converse.api, "trigger"); - const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length); await test_utils.openChatBoxFor(_converse, sender_jid); @@ -713,12 +713,12 @@ async function (done, _converse) { let contact, sent_stanza, IQ_id, stanza; - await test_utils.waitUntilDiscoConfirmed(_converse, 'localhost', [], ['vcard-temp']); + await test_utils.waitUntilDiscoConfirmed(_converse, 'montague.lit', [], ['vcard-temp']); await test_utils.waitUntil(() => _converse.xmppstatus.vcard.get('fullname')); await test_utils.waitForRoster(_converse, 'current'); // Send a message from a different resource spyOn(_converse, 'log'); - const recipient_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost'; + const recipient_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const view = await test_utils.openChatBoxFor(_converse, recipient_jid); const msg = $msg({ 'from': _converse.bare_jid, @@ -759,7 +759,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; test_utils.openControlBox(); await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group li').length, 700); _converse.TIMEOUTS.PAUSED = 200; // Make the timeout shorter so that we can test @@ -818,7 +818,7 @@ // TODO: only show paused state if the previous state was composing // See XEP-0085 https://xmpp.org/extensions/xep-0085.html#definitions spyOn(_converse.api, "trigger").and.callThrough(); - const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const view = await test_utils.openChatBoxFor(_converse, sender_jid); // state const msg = $msg({ @@ -841,12 +841,12 @@ async function (done, _converse) { let contact, sent_stanza, IQ_id, stanza; - await test_utils.waitUntilDiscoConfirmed(_converse, 'localhost', [], ['vcard-temp']); + await test_utils.waitUntilDiscoConfirmed(_converse, 'montague.lit', [], ['vcard-temp']); await test_utils.waitUntil(() => _converse.xmppstatus.vcard.get('fullname')); await test_utils.waitForRoster(_converse, 'current'); // Send a message from a different resource spyOn(_converse, 'log'); - const recipient_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost'; + const recipient_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const view = await test_utils.openChatBoxFor(_converse, recipient_jid); const msg = $msg({ 'from': _converse.bare_jid, @@ -891,7 +891,7 @@ _converse.TIMEOUTS.INACTIVE = 200; await test_utils.waitForRoster(_converse, 'current'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; test_utils.openControlBox(); await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length, 1000); await test_utils.openChatBoxFor(_converse, contact_jid); @@ -939,7 +939,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.chatboxviews.get(contact_jid); spyOn(_converse.connection, 'send'); @@ -958,7 +958,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; test_utils.openControlBox(); await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length); const view = await test_utils.openChatBoxFor(_converse, contact_jid); @@ -984,7 +984,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; // See XEP-0085 https://xmpp.org/extensions/xep-0085.html#definitions spyOn(_converse.api, "trigger"); await test_utils.openChatBoxFor(_converse, sender_jid); @@ -1028,7 +1028,7 @@ test_utils.openControlBox(); spyOn(_converse.api, "trigger"); - const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; // state const msg = $msg({ from: sender_jid, @@ -1057,7 +1057,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; spyOn(_converse.api, "trigger"); await test_utils.openChatBoxFor(_converse, contact_jid); @@ -1103,7 +1103,7 @@ expect(_converse.msg_counter).toBe(0); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const view = await test_utils.openChatBoxFor(_converse, sender_jid) const previous_state = _converse.windowState; @@ -1158,7 +1158,7 @@ spyOn(_converse, 'incrementMsgCounter').and.callThrough(); _converse.saveWindowState(null, 'focus'); const message = 'This message will not increment the message counter'; - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost', + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit', msg = $msg({ from: sender_jid, to: _converse.connection.jid, @@ -1181,7 +1181,7 @@ // initial state expect(_converse.msg_counter).toBe(0); const message = 'This message will always increment the message counter from zero', - sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost', + sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit', msgFactory = function () { return $msg({ from: sender_jid, @@ -1228,7 +1228,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost', + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit', msg = test_utils.createChatMessage(_converse, sender_jid, 'This message will be unread'); const view = await test_utils.openChatBoxFor(_converse, sender_jid) @@ -1246,7 +1246,7 @@ await test_utils.waitForRoster(_converse, 'current'); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost', + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit', msg = test_utils.createChatMessage(_converse, sender_jid, 'This message will be read'); await test_utils.openChatBoxFor(_converse, sender_jid); @@ -1262,7 +1262,7 @@ await test_utils.waitForRoster(_converse, 'current'); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msgFactory = function () { return test_utils.createChatMessage(_converse, sender_jid, 'This message will be unread'); }; @@ -1281,7 +1281,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msgFactory = () => test_utils.createChatMessage(_converse, sender_jid, 'This message will be unread'); await test_utils.openChatBoxFor(_converse, sender_jid); const chatbox = _converse.chatboxes.get(sender_jid); @@ -1299,7 +1299,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msgFactory = () => test_utils.createChatMessage(_converse, sender_jid, 'This message will be unread'); await test_utils.openChatBoxFor(_converse, sender_jid); const chatbox = _converse.chatboxes.get(sender_jid); @@ -1318,7 +1318,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msgFactory = () => test_utils.createChatMessage(_converse, sender_jid, 'This message will be unread'); await test_utils.openChatBoxFor(_converse, sender_jid); const chatbox = _converse.chatboxes.get(sender_jid); @@ -1342,7 +1342,7 @@ await test_utils.waitForRoster(_converse, 'current', 1); let msg, indicator_el; - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length, 500); await test_utils.openChatBoxFor(_converse, sender_jid); const chatbox = _converse.chatboxes.get(sender_jid); @@ -1367,7 +1367,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; let indicator_el, msg; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length, 500); @@ -1397,7 +1397,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msgFactory = () => test_utils.createChatMessage(_converse, sender_jid, 'This message will be received as unread, but eventually will be read'); await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length, 500); await test_utils.openChatBoxFor(_converse, sender_jid); @@ -1423,7 +1423,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length, 500); await test_utils.openChatBoxFor(_converse, sender_jid); const chatbox = _converse.chatboxes.get(sender_jid); @@ -1447,7 +1447,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length, 500); await test_utils.openChatBoxFor(_converse, sender_jid); const chatbox = _converse.chatboxes.get(sender_jid); @@ -1474,7 +1474,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, sender_jid); const msgFactory = function () { return test_utils.createChatMessage(_converse, sender_jid, 'This message will be received as unread, but eventually will be read'); @@ -1502,7 +1502,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const view = await test_utils.openChatBoxFor(_converse, sender_jid) const msgFactory = function () { return test_utils.createChatMessage(_converse, sender_jid, @@ -1530,7 +1530,7 @@ const base_url = document.URL.split(window.location.pathname)[0], message = "geo:37.786971,-122.399677", - contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.chatboxviews.get(contact_jid); diff --git a/spec/controlbox.js b/spec/controlbox.js index fcd65516f..bf45410a9 100644 --- a/spec/controlbox.js +++ b/spec/controlbox.js @@ -48,13 +48,13 @@ test_utils.openControlBox(); // Adding two contacts one with Capital initials and one with small initials of same JID (Case sensitive check) _converse.roster.create({ - jid: mock.pend_names[0].replace(/ /g,'.').toLowerCase() + '@localhost', + jid: mock.pend_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit', subscription: 'none', ask: 'subscribe', fullname: mock.pend_names[0] }); _converse.roster.create({ - jid: mock.pend_names[0].replace(/ /g,'.') + '@localhost', + jid: mock.pend_names[0].replace(/ /g,'.') + '@montague.lit', subscription: 'none', ask: 'subscribe', fullname: mock.pend_names[0] @@ -74,7 +74,7 @@ test_utils.createContacts(_converse, 'all').openControlBox(); _converse.api.trigger('rosterContactsFetched'); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, sender_jid); await test_utils.waitUntil(() => _converse.chatboxes.length); const chatview = _converse.chatboxviews.get(sender_jid); @@ -208,13 +208,13 @@ input_jid.value = 'someone@'; const evt = new Event('input'); input_jid.dispatchEvent(evt); - expect(modal.el.querySelector('.suggestion-box li').textContent).toBe('someone@localhost'); - input_jid.value = 'someone@localhost'; + expect(modal.el.querySelector('.suggestion-box li').textContent).toBe('someone@montague.lit'); + input_jid.value = 'someone@montague.lit'; input_name.value = 'Someone'; modal.el.querySelector('button[type="submit"]').click(); expect(sent_stanza.toLocaleString()).toEqual( ``+ - ``+ + ``+ ``); done(); })); @@ -236,7 +236,7 @@ expect(!_.isNull(modal.el.querySelector('form.add-xmpp-contact'))).toBeTruthy(); const input_jid = modal.el.querySelector('input[name="jid"]'); const input_name = modal.el.querySelector('input[name="name"]'); - input_jid.value = 'someone@localhost'; + input_jid.value = 'someone@montague.lit'; modal.el.querySelector('button[type="submit"]').click(); const IQ_stanzas = _converse.connection.IQ_stanzas; @@ -245,7 +245,7 @@ ); expect(Strophe.serialize(sent_stanza)).toEqual( ``+ - ``+ + ``+ `` ); done(); @@ -324,10 +324,10 @@ 'send': function () { const value = modal.el.querySelector('input[name="name"]').value; if (value === 'existing') { - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; xhr.responseText = JSON.stringify([{"jid": contact_jid, "fullname": mock.cur_names[0]}]); - } else if (value === 'dummy') { - xhr.responseText = JSON.stringify([{"jid": "dummy@localhost", "fullname": "Max Mustermann"}]); + } else if (value === 'romeo') { + xhr.responseText = JSON.stringify([{"jid": "romeo@montague.lit", "fullname": "Romeo Montague"}]); } else if (value === 'ambiguous') { xhr.responseText = JSON.stringify([ {"jid": "marty@mcfly.net", "fullname": "Marty McFly"}, @@ -374,7 +374,7 @@ expect(feedback_el.textContent).toBe('Sorry, could not find a contact with that name'); feedback_el.textContent = ''; - input_el.value = 'dummy'; + input_el.value = 'romeo'; modal.el.querySelector('button[type="submit"]').click(); feedback_el = modal.el.querySelector('.invalid-feedback'); expect(feedback_el.textContent).toBe('You cannot add yourself as a contact'); diff --git a/spec/converse.js b/spec/converse.js index b8552d365..6d531f2e7 100644 --- a/spec/converse.js +++ b/spec/converse.js @@ -254,16 +254,16 @@ let contact = await _converse.api.contacts.get('non-existing@jabber.org'); expect(contact).toBeFalsy(); // Check when a single jid is given - const jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; contact = await _converse.api.contacts.get(jid); - expect(contact.get('fullname')).toBe(mock.cur_names[0]); + expect(contact.getDisplayName()).toBe(mock.cur_names[0]); expect(contact.get('jid')).toBe(jid); // You can retrieve multiple contacts by passing in an array - const jid2 = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + const jid2 = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; let list = await _converse.api.contacts.get([jid, jid2]); expect(Array.isArray(list)).toBeTruthy(); - expect(list[0].get('fullname')).toBe(mock.cur_names[0]); - expect(list[1].get('fullname')).toBe(mock.cur_names[1]); + expect(list[0].getDisplayName()).toBe(mock.cur_names[0]); + expect(list[1].getDisplayName()).toBe(mock.cur_names[1]); // Check that all JIDs are returned if you call without any parameters list = await _converse.api.contacts.get(); expect(list.length).toBe(mock.cur_names.length); @@ -294,8 +294,8 @@ // Test on chat that doesn't exist. expect(_converse.api.chats.get('non-existing@jabber.org')).toBeFalsy(); - const jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; - const jid2 = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + const jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; + const jid2 = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; // Test on chat that's not open let box = _converse.api.chats.get(jid); @@ -327,8 +327,8 @@ test_utils.createContacts(_converse, 'current', 2); _converse.api.trigger('rosterContactsFetched'); - const jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; - const jid2 = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + const jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; + const jid2 = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; // Test on chat that doesn't exist. expect(_converse.api.chats.get('non-existing@jabber.org')).toBeFalsy(); diff --git a/spec/disco.js b/spec/disco.js index b272a8a81..6ee07541b 100644 --- a/spec/disco.js +++ b/spec/disco.js @@ -22,7 +22,7 @@ const IQ_ids = _converse.connection.IQ_ids; test_utils.waitUntil(function () { return _.filter(IQ_stanzas, function (iq) { - return iq.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]'); + return iq.querySelector('iq[to="montague.lit"] query[xmlns="http://jabber.org/protocol/disco#info"]'); }).length > 0; }, 300).then(function () { /* */ var stanza = _.find(IQ_stanzas, function (iq) { - return iq.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]'); + return iq.querySelector('iq[to="montague.lit"] query[xmlns="http://jabber.org/protocol/disco#info"]'); }); var info_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)]; stanza = $iq({ 'type': 'result', - 'from': 'localhost', - 'to': 'dummy@localhost/resource', + 'from': 'montague.lit', + 'to': 'romeo@montague.lit/orchard', 'id': info_IQ_id }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'}) .c('identity', { @@ -88,12 +88,12 @@ expect(entities.length).toBe(2); // We have an extra entity, which is the user's JID expect(entities.get(_converse.domain).features.length).toBe(5); expect(entities.get(_converse.domain).identities.length).toBe(3); - expect(entities.get('localhost').features.where({'var': 'jabber:iq:version'}).length).toBe(1); - expect(entities.get('localhost').features.where({'var': 'jabber:iq:time'}).length).toBe(1); - expect(entities.get('localhost').features.where({'var': 'jabber:iq:register'}).length).toBe(1); - expect(entities.get('localhost').features.where( + expect(entities.get('montague.lit').features.where({'var': 'jabber:iq:version'}).length).toBe(1); + expect(entities.get('montague.lit').features.where({'var': 'jabber:iq:time'}).length).toBe(1); + expect(entities.get('montague.lit').features.where({'var': 'jabber:iq:register'}).length).toBe(1); + expect(entities.get('montague.lit').features.where( {'var': 'http://jabber.org/protocol/disco#items'}).length).toBe(1); - expect(entities.get('localhost').features.where( + expect(entities.get('montague.lit').features.where( {'var': 'http://jabber.org/protocol/disco#info'}).length).toBe(1); @@ -131,13 +131,13 @@ * */ var stanza = _.find(IQ_stanzas, function (iq) { - return iq.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#items"]'); + return iq.querySelector('iq[to="montague.lit"] query[xmlns="http://jabber.org/protocol/disco#items"]'); }); var items_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)]; stanza = $iq({ 'type': 'result', - 'from': 'localhost', - 'to': 'dummy@localhost/resource', + 'from': 'montague.lit', + 'to': 'romeo@montague.lit/orchard', 'id': items_IQ_id }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#items'}) .c('item', { @@ -151,14 +151,14 @@ 'name': 'Gateway to Marlowe IM'}).up() .c('item', { - 'jid': 'localhost', + 'jid': 'montague.lit', 'node': 'books', 'name': 'Books by and about Shakespeare'}).up() .c('item', { - 'node': 'localhost', + 'node': 'montague.lit', 'name': 'Wear your literary taste with pride'}).up() .c('item', { - 'jid': 'localhost', + 'jid': 'montague.lit', 'node': 'music', 'name': 'Music from the time of Shakespeare' }); diff --git a/spec/headline.js b/spec/headline.js index b8a408336..d20740ee9 100644 --- a/spec/headline.js +++ b/spec/headline.js @@ -16,7 +16,7 @@ /* XMPP spam message: * * * -wwdmz @@ -26,7 +26,7 @@ sinon.spy(utils, 'isHeadlineMessage'); const stanza = $msg({ 'xmlns': 'jabber:client', - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'type': 'chat', 'from': 'gapowa20102106@rds-rostov.ru/Adium', }) @@ -59,7 +59,7 @@ const stanza = $msg({ 'type': 'headline', 'from': 'notify.example.com', - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'xml:lang': 'en' }) .c('subject').t('SIEVE').up() @@ -91,7 +91,7 @@ var stanza = $msg({ 'type': 'headline', 'from': 'andre5114@jabber.snc.ru/Spark', - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'xml:lang': 'en' }) .c('nick').t('gpocy').up() diff --git a/spec/http-file-upload.js b/spec/http-file-upload.js index b37c85cd0..0a382bf71 100644 --- a/spec/http-file-upload.js +++ b/spec/http-file-upload.js @@ -21,7 +21,7 @@ await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, [], []); await test_utils.waitUntil(() => _.filter( IQ_stanzas, - iq => iq.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]')).length + iq => iq.querySelector('iq[to="montague.lit"] query[xmlns="http://jabber.org/protocol/disco#info"]')).length ); /* _.filter( IQ_stanzas, - iq => iq.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#items"]') + iq => iq.querySelector('iq[to="montague.lit"] query[xmlns="http://jabber.org/protocol/disco#items"]') ).length ); /* */ stanza = _.find(IQ_stanzas, function (iq) { - return iq.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#items"]'); + return iq.querySelector('iq[to="montague.lit"] query[xmlns="http://jabber.org/protocol/disco#items"]'); }); const items_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)]; stanza = $iq({ 'type': 'result', - 'from': 'localhost', - 'to': 'dummy@localhost/resource', + 'from': 'montague.lit', + 'to': 'romeo@montague.lit/orchard', 'id': items_IQ_id }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#items'}) .c('item', { - 'jid': 'upload.localhost', + 'jid': 'upload.montague.lit', 'name': 'HTTP File Upload'}); _converse.connection._dataRecv(test_utils.createRequest(stanza)); _converse.api.disco.entities.get().then(function (entities) { expect(entities.length).toBe(2); - expect(entities.get('localhost').items.length).toBe(1); + expect(entities.get('montague.lit').items.length).toBe(1); return test_utils.waitUntil(function () { // Converse.js sees that the entity has a disco#info feature, // so it will make a query for it. return _.filter(IQ_stanzas, function (iq) { - return iq.querySelector('iq[to="upload.localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]'); + return iq.querySelector('iq[to="upload.montague.lit"] query[xmlns="http://jabber.org/protocol/disco#info"]'); }).length > 0; }, 300); }); @@ -113,13 +113,13 @@ stanza = await test_utils.waitUntil(() => _.filter( IQ_stanzas, - iq => iq.querySelector('iq[to="upload.localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]') + iq => iq.querySelector('iq[to="upload.montague.lit"] query[xmlns="http://jabber.org/protocol/disco#info"]') ).pop() ); const IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)]; expect(Strophe.serialize(stanza)).toBe( - ``+ + ``+ ``+ ``); @@ -144,7 +144,7 @@ * * */ - stanza = $iq({'type': 'result', 'to': 'dummy@localhost/resource', 'id': IQ_id, 'from': 'upload.localhost'}) + stanza = $iq({'type': 'result', 'to': 'romeo@montague.lit/orchard', 'id': IQ_id, 'from': 'upload.montague.lit'}) .c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'}) .c('identity', {'category':'store', 'type':'file', 'name':'HTTP File Upload'}).up() .c('feature', {'var':'urn:xmpp:http:upload:0'}).up() @@ -156,12 +156,12 @@ _converse.connection._dataRecv(test_utils.createRequest(stanza)); entities = await _converse.api.disco.entities.get(); - expect(entities.get('localhost').items.get('upload.localhost').identities.where({'category': 'store'}).length).toBe(1); + expect(entities.get('montague.lit').items.get('upload.montague.lit').identities.where({'category': 'store'}).length).toBe(1); const supported = await _converse.api.disco.supports(Strophe.NS.HTTPUPLOAD, _converse.domain); expect(supported).toBe(true); const features = await _converse.api.disco.features.get(Strophe.NS.HTTPUPLOAD, _converse.domain); expect(features.length).toBe(1); - expect(features[0].get('jid')).toBe('upload.localhost'); + expect(features[0].get('jid')).toBe('upload.montague.lit'); expect(features[0].dataforms.where({'FORM_TYPE': {value: "urn:xmpp:http:upload:0", type: "hidden"}}).length).toBe(1); done(); })); @@ -171,7 +171,7 @@ describe("A file upload toolbar button", function () { it("does not appear in private chats", mock.initConverse(async (done, _converse) => { - var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + var contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; test_utils.createContacts(_converse, 'current'); test_utils.openChatBoxFor(_converse, contact_jid); @@ -190,15 +190,15 @@ null, ['rosterGroupsFetched'], {}, async (done, _converse) => { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); test_utils.waitUntilDiscoConfirmed( _converse, _converse.domain, [{'category': 'server', 'type':'IM'}], ['http://jabber.org/protocol/disco#items'], [], 'info'); - await test_utils.waitUntilDiscoConfirmed(_converse, _converse.domain, [], [], ['upload.localhost'], 'items'); - await test_utils.waitUntilDiscoConfirmed(_converse, 'upload.localhost', [], [Strophe.NS.HTTPUPLOAD], []); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.waitUntilDiscoConfirmed(_converse, _converse.domain, [], [], ['upload.montague.lit'], 'items'); + await test_utils.waitUntilDiscoConfirmed(_converse, 'upload.montague.lit', [], [Strophe.NS.HTTPUPLOAD], []); + const view = _converse.chatboxviews.get('lounge@montague.lit'); expect(view.el.querySelector('.chat-toolbar .upload-file')).toBe(null); done(); })); @@ -216,11 +216,11 @@ [{'category': 'server', 'type':'IM'}], ['http://jabber.org/protocol/disco#items'], [], 'info'); - await test_utils.waitUntilDiscoConfirmed(_converse, _converse.domain, [], [], ['upload.localhost'], 'items') - await test_utils.waitUntilDiscoConfirmed(_converse, 'upload.localhost', [], [Strophe.NS.HTTPUPLOAD], []); + await test_utils.waitUntilDiscoConfirmed(_converse, _converse.domain, [], [], ['upload.montague.lit'], 'items') + await test_utils.waitUntilDiscoConfirmed(_converse, 'upload.montague.lit', [], [Strophe.NS.HTTPUPLOAD], []); test_utils.createContacts(_converse, 'current', 3); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.chatboxviews.get(contact_jid); test_utils.waitUntil(() => view.el.querySelector('.upload-file')); @@ -237,11 +237,11 @@ [{'category': 'server', 'type':'IM'}], ['http://jabber.org/protocol/disco#items'], [], 'info'); - await test_utils.waitUntilDiscoConfirmed(_converse, _converse.domain, [], [], ['upload.localhost'], 'items'); - await test_utils.waitUntilDiscoConfirmed(_converse, 'upload.localhost', [], [Strophe.NS.HTTPUPLOAD], []); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - await test_utils.waitUntil(() => _converse.chatboxviews.get('lounge@localhost').el.querySelector('.upload-file')); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.waitUntilDiscoConfirmed(_converse, _converse.domain, [], [], ['upload.montague.lit'], 'items'); + await test_utils.waitUntilDiscoConfirmed(_converse, 'upload.montague.lit', [], [Strophe.NS.HTTPUPLOAD], []); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + await test_utils.waitUntil(() => _converse.chatboxviews.get('lounge@montague.lit').el.querySelector('.upload-file')); + const view = _converse.chatboxviews.get('lounge@montague.lit'); expect(view.el.querySelector('.chat-toolbar .upload-file')).not.toBe(null); done(); })); @@ -262,7 +262,7 @@ await test_utils.waitUntilDiscoConfirmed(_converse, 'upload.montague.tld', [], [Strophe.NS.HTTPUPLOAD], []); test_utils.createContacts(_converse, 'current'); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.chatboxviews.get(contact_jid); const file = { @@ -277,7 +277,7 @@ await test_utils.waitUntil(() => _.filter(IQ_stanzas, iq => iq.querySelector('iq[to="upload.montague.tld"] request')).length); const iq = IQ_stanzas.pop(); expect(Strophe.serialize(iq)).toBe( - ` @@ -328,9 +328,9 @@ await test_utils.waitUntil(() => sent_stanza, 1000); expect(sent_stanza.toLocaleString()).toBe( - ``+ `${message}`+ @@ -365,13 +365,13 @@ await test_utils.waitUntilDiscoConfirmed(_converse, _converse.domain, [], [], ['upload.montague.tld'], 'items'); await test_utils.waitUntilDiscoConfirmed(_converse, 'upload.montague.tld', [], [Strophe.NS.HTTPUPLOAD], []); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); // Wait until MAM query has been sent out const sent_stanzas = _converse.connection.sent_stanzas; await test_utils.waitUntil(() => sent_stanzas.filter(s => sizzle(`[xmlns="${Strophe.NS.MAM}"]`, s).length).pop()); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); const file = { 'type': 'image/jpeg', 'size': '23456' , @@ -384,7 +384,7 @@ await test_utils.waitUntil(() => _.filter(IQ_stanzas, iq => iq.querySelector('iq[to="upload.montague.tld"] request')).length); const iq = IQ_stanzas.pop(); expect(Strophe.serialize(iq)).toBe( - ` @@ -435,9 +435,9 @@ await test_utils.waitUntil(() => sent_stanza, 1000); expect(sent_stanza.toLocaleString()).toBe( ``+ `${message}`+ @@ -466,18 +466,18 @@ await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, [], []); await test_utils.waitUntil(() => _.filter( IQ_stanzas, - iq => iq.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]')).length + iq => iq.querySelector('iq[to="montague.lit"] query[xmlns="http://jabber.org/protocol/disco#info"]')).length ); let stanza = _.find(IQ_stanzas, function (iq) { return iq.querySelector( - 'iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]'); + 'iq[to="montague.lit"] query[xmlns="http://jabber.org/protocol/disco#info"]'); }); const info_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)]; stanza = $iq({ 'type': 'result', - 'from': 'localhost', - 'to': 'dummy@localhost/resource', + 'from': 'montague.lit', + 'to': 'romeo@montague.lit/orchard', 'id': info_IQ_id }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'}) .c('identity', { @@ -491,8 +491,8 @@ let entities = await _converse.api.disco.entities.get(); expect(entities.length).toBe(2); - expect(_.includes(entities.pluck('jid'), 'localhost')).toBe(true); - expect(_.includes(entities.pluck('jid'), 'dummy@localhost')).toBe(true); + expect(_.includes(entities.pluck('jid'), 'montague.lit')).toBe(true); + expect(_.includes(entities.pluck('jid'), 'romeo@montague.lit')).toBe(true); expect(entities.get(_converse.domain).features.length).toBe(2); expect(entities.get(_converse.domain).identities.length).toBe(1); @@ -501,22 +501,22 @@ // Converse.js sees that the entity has a disco#items feature, // so it will make a query for it. return _.filter(IQ_stanzas, function (iq) { - return iq.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#items"]'); + return iq.querySelector('iq[to="montague.lit"] query[xmlns="http://jabber.org/protocol/disco#items"]'); }).length > 0; }, 300); stanza = _.find(IQ_stanzas, function (iq) { - return iq.querySelector('iq[to="localhost"] query[xmlns="http://jabber.org/protocol/disco#items"]'); + return iq.querySelector('iq[to="montague.lit"] query[xmlns="http://jabber.org/protocol/disco#items"]'); }); var items_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)]; stanza = $iq({ 'type': 'result', - 'from': 'localhost', - 'to': 'dummy@localhost/resource', + 'from': 'montague.lit', + 'to': 'romeo@montague.lit/orchard', 'id': items_IQ_id }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#items'}) .c('item', { - 'jid': 'upload.localhost', + 'jid': 'upload.montague.lit', 'name': 'HTTP File Upload'}); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -524,24 +524,24 @@ entities = await _converse.api.disco.entities.get() expect(entities.length).toBe(2); - expect(entities.get('localhost').items.length).toBe(1); + expect(entities.get('montague.lit').items.length).toBe(1); await test_utils.waitUntil(function () { // Converse.js sees that the entity has a disco#info feature, // so it will make a query for it. return _.filter(IQ_stanzas, function (iq) { - return iq.querySelector('iq[to="upload.localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]'); + return iq.querySelector('iq[to="upload.montague.lit"] query[xmlns="http://jabber.org/protocol/disco#info"]'); }).length > 0; }, 300); - stanza = _.find(IQ_stanzas, iq => iq.querySelector('iq[to="upload.localhost"] query[xmlns="http://jabber.org/protocol/disco#info"]')); + stanza = _.find(IQ_stanzas, iq => iq.querySelector('iq[to="upload.montague.lit"] query[xmlns="http://jabber.org/protocol/disco#info"]')); const IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)]; expect(Strophe.serialize(stanza)).toBe( - ``+ + ``+ ``+ ``); // Upload service responds and reports a maximum file size of 5MiB - stanza = $iq({'type': 'result', 'to': 'dummy@localhost/resource', 'id': IQ_id, 'from': 'upload.localhost'}) + stanza = $iq({'type': 'result', 'to': 'romeo@montague.lit/orchard', 'id': IQ_id, 'from': 'upload.montague.lit'}) .c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'}) .c('identity', {'category':'store', 'type':'file', 'name':'HTTP File Upload'}).up() .c('feature', {'var':'urn:xmpp:http:upload:0'}).up() @@ -552,12 +552,12 @@ .c('value').t('5242880'); _converse.connection._dataRecv(test_utils.createRequest(stanza)); entities = await _converse.api.disco.entities.get(); - expect(entities.get('localhost').items.get('upload.localhost').identities.where({'category': 'store'}).length).toBe(1); + expect(entities.get('montague.lit').items.get('upload.montague.lit').identities.where({'category': 'store'}).length).toBe(1); await _converse.api.disco.supports(Strophe.NS.HTTPUPLOAD, _converse.domain); test_utils.createContacts(_converse, 'current'); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.chatboxviews.get(contact_jid); var file = { @@ -595,7 +595,7 @@ await test_utils.waitUntilDiscoConfirmed(_converse, 'upload.montague.tld', [], [Strophe.NS.HTTPUPLOAD], []); test_utils.createContacts(_converse, 'current'); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.chatboxviews.get(contact_jid); const file = { @@ -609,7 +609,7 @@ await test_utils.waitUntil(() => _.filter(IQ_stanzas, iq => iq.querySelector('iq[to="upload.montague.tld"] request')).length) const iq = IQ_stanzas.pop(); expect(Strophe.serialize(iq)).toBe( - ` diff --git a/spec/login.js b/spec/login.js index 033334e9e..5bfeb1968 100644 --- a/spec/login.js +++ b/spec/login.js @@ -21,7 +21,7 @@ expect(label.textContent).toBe('This is a trusted device'); expect(checkbox.checked).toBe(true); - cbview.el.querySelector('input[name="jid"]').value = 'dummy@localhost'; + cbview.el.querySelector('input[name="jid"]').value = 'romeo@montague.lit'; cbview.el.querySelector('input[name="password"]').value = 'secret'; spyOn(cbview.loginpanel, 'connect'); @@ -58,7 +58,7 @@ expect(label.textContent).toBe('This is a trusted device'); expect(checkbox.checked).toBe(false); - cbview.el.querySelector('input[name="jid"]').value = 'dummy@localhost'; + cbview.el.querySelector('input[name="jid"]').value = 'romeo@montague.lit'; cbview.el.querySelector('input[name="password"]').value = 'secret'; spyOn(cbview.loginpanel, 'connect'); diff --git a/spec/mam.js b/spec/mam.js index 9ebeaae7e..6984ca6d4 100644 --- a/spec/mam.js +++ b/spec/mam.js @@ -24,11 +24,11 @@ null, ['discoInitialized'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'trek-radio', 'conference.lightwitch.org', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'trek-radio', 'conference.lightwitch.org', 'romeo'); const view = _converse.chatboxviews.get('trek-radio@conference.lightwitch.org'); let stanza = u.toStanza( - ` + ` Hello `); @@ -40,7 +40,7 @@ stanza = u.toStanza( ` @@ -111,10 +111,10 @@ null, ['discoInitialized'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'discuss', 'conference.conversejs.org', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'discuss', 'conference.conversejs.org', 'romeo'); const view = _converse.chatboxviews.get('discuss@conference.conversejs.org'); let stanza = u.toStanza( - ` + ` @@ -132,7 +132,7 @@ expect(view.content.querySelectorAll('.chat-msg').length).toBe(1); stanza = u.toStanza( - ` + ` @@ -272,13 +272,13 @@ * * */ - const msg1 = $msg({'id':'iasd207', 'from': 'other@chat.shakespear.lit', 'to': 'dummy@localhost'}) + const msg1 = $msg({'id':'iasd207', 'from': 'other@chat.shakespear.lit', 'to': 'romeo@montague.lit'}) .c('result', {'xmlns': 'urn:xmpp:mam:2', 'queryid':queryid, 'id':'34482-21985-73620'}) .c('forwarded', {'xmlns':'urn:xmpp:forward:0'}) .c('delay', {'xmlns':'urn:xmpp:delay', 'stamp':'2010-07-10T23:08:25Z'}).up() .c('message', { 'xmlns':'jabber:client', - 'to':'dummy@localhost', + 'to':'romeo@montague.lit', 'id':'162BEBB1-F6DB-4D9A-9BD8-CFDCC801A0B2', 'from':'coven@chat.shakespeare.lit/firstwitch', 'type':'groupchat' }) @@ -728,7 +728,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); @@ -747,7 +747,7 @@ ``+ ``+ `urn:xmpp:mam:2`+ - `max.frankfurter@localhost`+ + `mercutio@montague.lit`+ ``+ `50`+ ``+ diff --git a/spec/messages.js b/spec/messages.js index f6b954a3b..ad6c51f0e 100644 --- a/spec/messages.js +++ b/spec/messages.js @@ -19,7 +19,7 @@ await test_utils.waitForRoster(_converse, 'current', 1); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.api.chatviews.get(contact_jid); const textarea = view.el.querySelector('textarea.chat-textarea'); @@ -63,8 +63,8 @@ const msg = _converse.connection.send.calls.all()[0].args[0]; expect(msg.toLocaleString()) - .toBe(``+ `But soft, what light through yonder window breaks?`+ ``+ @@ -126,7 +126,7 @@ await test_utils.waitForRoster(_converse, 'current', 1); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) const view = _converse.chatboxviews.get(contact_jid); const textarea = view.el.querySelector('textarea.chat-textarea'); @@ -171,8 +171,8 @@ const msg = _converse.connection.send.calls.all()[0].args[0]; expect(msg.toLocaleString()) - .toBe(``+ `But soft, what light through yonder window breaks?`+ ``+ @@ -287,7 +287,7 @@ test_utils.openControlBox(); let message, msg; - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length) spyOn(_converse, 'log'); spyOn(_converse.chatboxes, 'getChatBox').and.callThrough(); @@ -479,14 +479,14 @@ sinon.spy(_converse.chatboxes, 'getChatBox'); sinon.spy(u, 'isHeadlineMessage'); const msg = $msg({ - from: 'localhost', + from: 'montague.lit', to: _converse.bare_jid, type: 'chat', id: (new Date()).getTime() }).c('body').t("This headline message will not be shown").tree(); await _converse.chatboxes.onMessage(msg); expect(_converse.log.calledWith( - "onMessage: Ignoring incoming headline message from JID: localhost", + "onMessage: Ignoring incoming headline message from JID: montague.lit", Strophe.LogLevel.INFO )).toBeTruthy(); expect(u.isHeadlineMessage.called).toBeTruthy(); @@ -512,7 +512,7 @@ // Send a message from a different resource spyOn(_converse, 'log'); const msgtext = 'This is a carbon message'; - const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msg = $msg({ 'from': _converse.bare_jid, 'id': (new Date()).getTime(), @@ -548,8 +548,8 @@ await new Promise((resolve, reject) => view.once('messageInserted', resolve)); expect(chat_content.querySelector('.chat-msg .chat-msg__text').textContent).toEqual(msgtext); expect(chat_content.querySelector('.chat-msg__time').textContent.match(/^[0-9][0-9]:[0-9][0-9]/)).toBeTruthy(); - await test_utils.waitUntil(() => chatbox.vcard.get('fullname') === 'Candice van der Knijff') - expect(chat_content.querySelector('span.chat-msg__author').textContent.trim()).toBe('Candice van der Knijff'); + await test_utils.waitUntil(() => chatbox.vcard.get('fullname') === 'Juliet Capulet') + expect(chat_content.querySelector('span.chat-msg__author').textContent.trim()).toBe('Juliet Capulet'); done(); })); @@ -558,14 +558,14 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.waitUntilDiscoConfirmed(_converse, 'localhost', [], ['vcard-temp']); + await test_utils.waitUntilDiscoConfirmed(_converse, 'montague.lit', [], ['vcard-temp']); await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); // Send a message from a different resource spyOn(_converse, 'log'); const msgtext = 'This is a sent carbon message'; - const recipient_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost'; + const recipient_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msg = $msg({ 'from': _converse.bare_jid, 'id': (new Date()).getTime(), @@ -620,8 +620,8 @@ */ spyOn(_converse, 'log'); const msgtext = 'Please come to Creepy Valley tonight, alone!'; - const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; - const impersonated_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; + const impersonated_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msg = $msg({ 'from': sender_jid, 'id': (new Date()).getTime(), @@ -658,7 +658,7 @@ } await test_utils.waitForRoster(_converse, 'current'); const contact_name = mock.cur_names[0]; - const contact_jid = contact_name.replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = contact_name.replace(/ /g,'.').toLowerCase() + '@montague.lit'; test_utils.openControlBox(); spyOn(_converse.api, "trigger").and.callThrough(); @@ -670,7 +670,7 @@ chatview.el.querySelector('.toggle-chatbox-button').click(); expect(chatview.model.get('minimized')).toBeTruthy(); var message = 'This message is sent to a minimized chatbox'; - var sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + var sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; var msg = $msg({ from: sender_jid, to: _converse.connection.jid, @@ -691,7 +691,7 @@ expect(count.textContent).toBe('1'); _converse.chatboxes.onMessage( $msg({ - from: mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost', + from: mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit', to: _converse.connection.jid, type: 'chat', id: (new Date()).getTime() @@ -720,7 +720,7 @@ test_utils.openControlBox(); spyOn(_converse.api, "trigger"); const contact_name = mock.cur_names[1]; - const contact_jid = contact_name.replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = contact_name.replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length); await test_utils.openChatBoxFor(_converse, contact_jid); @@ -736,7 +736,7 @@ type: 'chat', id: one_day_ago.toDate().getTime() }).c('body').t(message).up() - .c('delay', { xmlns:'urn:xmpp:delay', from: 'localhost', stamp: one_day_ago.toISOString() }) + .c('delay', { xmlns:'urn:xmpp:delay', from: 'montague.lit', stamp: one_day_ago.toISOString() }) .c('active', {'xmlns': 'http://jabber.org/protocol/chatstates'}).tree(); await _converse.chatboxes.onMessage(msg); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); @@ -749,11 +749,11 @@ expect(msg_obj.get('nickname')).toBe(null); expect(msg_obj.get('sender')).toEqual('them'); expect(msg_obj.get('is_delayed')).toEqual(true); - await test_utils.waitUntil(() => chatbox.vcard.get('fullname') === 'Candice van der Knijff') + await test_utils.waitUntil(() => chatbox.vcard.get('fullname') === 'Juliet Capulet') const chat_content = view.el.querySelector('.chat-content'); expect(chat_content.querySelector('.chat-msg .chat-msg__text').textContent).toEqual(message); expect(chat_content.querySelector('.chat-msg__time').textContent.match(/^[0-9][0-9]:[0-9][0-9]/)).toBeTruthy(); - expect(chat_content.querySelector('span.chat-msg__author').textContent.trim()).toBe('Candice van der Knijff'); + expect(chat_content.querySelector('span.chat-msg__author').textContent.trim()).toBe('Juliet Capulet'); expect(chat_content.querySelectorAll('.date-separator').length).toEqual(1); let day = chat_content.querySelector('.date-separator'); @@ -799,7 +799,7 @@ expect(chat_content.querySelector('.chat-msg:last-child .chat-msg__text').textContent).toEqual(message); expect(chat_content.querySelector('.chat-msg:last-child .chat-msg__time').textContent.match(/^[0-9][0-9]:[0-9][0-9]/)).toBeTruthy(); - expect(chat_content.querySelector('.chat-msg:last-child .chat-msg__author').textContent.trim()).toBe('Candice van der Knijff'); + expect(chat_content.querySelector('.chat-msg:last-child .chat-msg__author').textContent.trim()).toBe('Juliet Capulet'); done(); })); @@ -811,7 +811,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); spyOn(_converse.api, "trigger"); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) expect(_converse.api.trigger).toHaveBeenCalledWith('chatBoxFocused', jasmine.any(Object)); const view = _converse.chatboxviews.get(contact_jid); @@ -832,7 +832,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) const view = _converse.chatboxviews.get(contact_jid); const message = '

This message contains some markup

'; @@ -852,7 +852,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) const view = _converse.chatboxviews.get(contact_jid); const message = 'This message contains a hyperlink: www.opkode.com'; @@ -875,7 +875,7 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) const view = _converse.chatboxviews.get(contact_jid); @@ -933,7 +933,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.chatboxes.onMessage($msg({ 'from': sender_jid, 'to': _converse.connection.jid, @@ -957,12 +957,12 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const view = await test_utils.openChatBoxFor(_converse, contact_jid); let stanza = u.toStanza(` + to="romeo@montague.lit/orchard"> Hey\nHave you heard the news? `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -972,7 +972,7 @@ stanza = u.toStanza(` + to="romeo@montague.lit/orchard"> Hey\n\n\nHave you heard the news? `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -981,7 +981,7 @@ stanza = u.toStanza(` + to="romeo@montague.lit/orchard"> Hey\nHave you heard\nthe news? `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -998,7 +998,7 @@ await test_utils.waitForRoster(_converse, 'current'); let base_url = 'https://conversejs.org'; let message = base_url+"/logo/conversejs-filled.svg"; - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.chatboxviews.get(contact_jid); spyOn(view.model, 'sendMessage').and.callThrough(); @@ -1045,7 +1045,7 @@ await test_utils.waitForRoster(_converse, 'current'); _converse.time_format = 'hh:mm'; - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) const view = _converse.api.chatviews.get(contact_jid); const message = 'This message is sent from this chatbox'; @@ -1056,7 +1056,7 @@ const msg_object = chatbox.messages.models[0]; const msg_author = view.el.querySelector('.chat-content .chat-msg:last-child .chat-msg__author'); - expect(msg_author.textContent.trim()).toBe('Max Mustermann'); + expect(msg_author.textContent.trim()).toBe('Romeo Montague'); const msg_time = view.el.querySelector('.chat-content .chat-msg:last-child .chat-msg__time'); const time = dayjs(msg_object.get('time')).format(_converse.time_format); @@ -1077,7 +1077,7 @@ const ONE_MINUTE_LATER = 60000; await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length, 300); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.filter_by_resource = true; jasmine.clock().install(); @@ -1237,7 +1237,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msg_id = u.getUniqueId(); const sent_stanzas = []; spyOn(_converse.connection, 'send').and.callFake(function (stanza) { @@ -1263,7 +1263,7 @@ null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msg_id = u.getUniqueId(); const sent_stanzas = []; const view = await test_utils.openChatBoxFor(_converse, sender_jid); @@ -1294,7 +1294,7 @@ null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const recipient_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const recipient_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msg_id = u.getUniqueId(); const sent_stanzas = []; const view = await test_utils.openChatBoxFor(_converse, recipient_jid); @@ -1325,7 +1325,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.chatboxviews.get(contact_jid); const textarea = view.el.querySelector('textarea.chat-textarea'); @@ -1389,7 +1389,7 @@ await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group').length, 300); spyOn(_converse.api, "trigger").and.callThrough(); const message = 'This is a received message'; - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; // We don't already have an open chatbox for this user expect(_converse.chatboxes.get(sender_jid)).not.toBeDefined(); _converse.chatboxes.onMessage( @@ -1420,7 +1420,7 @@ expect(chat_content.querySelector('.chat-msg .chat-msg__text').textContent).toEqual(message); expect(chat_content.querySelector('.chat-msg__time').textContent.match(/^[0-9][0-9]:[0-9][0-9]/)).toBeTruthy(); await test_utils.waitUntil(() => chatbox.vcard.get('fullname') === mock.cur_names[0]); - expect(chat_content.querySelector('span.chat-msg__author').textContent.trim()).toBe('Max Frankfurter'); + expect(chat_content.querySelector('span.chat-msg__author').textContent.trim()).toBe('Mercutio'); done(); })); @@ -1432,7 +1432,7 @@ await test_utils.waitForRoster(_converse, 'current', 1); test_utils.openControlBox(); const message = 'This is a received message'; - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msg_id = u.getUniqueId(); const view = await test_utils.openChatBoxFor(_converse, sender_jid); _converse.chatboxes.onMessage($msg({ @@ -1495,7 +1495,7 @@ _converse.allow_non_roster_messaging = true; spyOn(_converse.api, "trigger").and.callThrough(); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; var vcard_fetched = false; spyOn(_converse.api.vcard, "get").and.callFake(function () { vcard_fetched = true; @@ -1530,14 +1530,14 @@ expect(chatbox.get('fullname') === sender_jid); await new Promise(resolve => view.once('messageInserted', resolve)); - await test_utils.waitUntil(() => view.el.querySelector('.chat-msg__author').textContent.trim() === 'Max Frankfurter'); + await test_utils.waitUntil(() => view.el.querySelector('.chat-msg__author').textContent.trim() === 'Mercutio'); let author_el = view.el.querySelector('.chat-msg__author'); - expect( _.includes(author_el.textContent.trim(), 'Max Frankfurter')).toBeTruthy(); + expect( _.includes(author_el.textContent.trim(), 'Mercutio')).toBeTruthy(); await test_utils.waitUntil(() => vcard_fetched, 100); expect(_converse.api.vcard.get).toHaveBeenCalled(); await test_utils.waitUntil(() => chatbox.vcard.get('fullname') === mock.cur_names[0]) author_el = view.el.querySelector('.chat-msg__author'); - expect( _.includes(author_el.textContent.trim(), 'Max Frankfurter')).toBeTruthy(); + expect( _.includes(author_el.textContent.trim(), 'Mercutio')).toBeTruthy(); done(); })); }); @@ -1555,7 +1555,7 @@ spyOn(_converse.api, "trigger"); const message = 'This is a received message from someone not on the roster'; - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const msg = $msg({ from: sender_jid, to: _converse.connection.jid, @@ -1593,12 +1593,12 @@ expect(msg_obj.get('sender')).toEqual('them'); expect(msg_obj.get('is_delayed')).toEqual(false); - await test_utils.waitUntil(() => view.el.querySelector('.chat-msg__author').textContent.trim() === 'Max Frankfurter'); + await test_utils.waitUntil(() => view.el.querySelector('.chat-msg__author').textContent.trim() === 'Mercutio'); // Now check that the message appears inside the chatbox in the DOM const chat_content = view.el.querySelector('.chat-content'); expect(chat_content.querySelector('.chat-msg .chat-msg__text').textContent).toEqual(message); expect(chat_content.querySelector('.chat-msg__time').textContent.match(/^[0-9][0-9]:[0-9][0-9]/)).toBeTruthy(); - expect(chat_content.querySelector('span.chat-msg__author').textContent.trim()).toBe('Max Frankfurter'); + expect(chat_content.querySelector('span.chat-msg__author').textContent.trim()).toBe('Mercutio'); done(); })); }); @@ -1630,7 +1630,7 @@ *
*/ const error_txt = 'Server-to-server connection failed: Connecting failed: connection timeout'; - const sender_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@montague.lit'; let fullname = _converse.xmppstatus.get('fullname'); fullname = _.isEmpty(fullname)? _converse.bare_jid: fullname; await _converse.api.chats.open(sender_jid) @@ -1760,13 +1760,13 @@ await test_utils.waitForRoster(_converse, 'current'); test_utils.openControlBox(); - const contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const messages = _converse.connection.sent_stanzas.filter(s => s.nodeName === 'message'); expect(messages.length).toBe(1); expect(Strophe.serialize(messages[0])).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -1795,7 +1795,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, sender_jid) const view = _converse.api.chatviews.get(sender_jid); // Create enough messages so that there's a scrollbar. @@ -1855,7 +1855,7 @@ spyOn(_converse, 'log'); spyOn(_converse.chatboxes, 'getChatBox').and.callThrough(); _converse.filter_by_resource = true; - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; let msg = $msg({ from: sender_jid, to: _converse.bare_jid+"/some-other-resource", @@ -1866,7 +1866,7 @@ await _converse.chatboxes.onMessage(msg); await test_utils.waitUntil(() => _converse.api.chats.get().length); expect(_converse.log).toHaveBeenCalledWith( - "onMessage: Ignoring incoming message intended for a different resource: dummy@localhost/some-other-resource", + "onMessage: Ignoring incoming message intended for a different resource: romeo@montague.lit/some-other-resource", Strophe.LogLevel.INFO); expect(_converse.chatboxes.getChatBox).not.toHaveBeenCalled(); _converse.filter_by_resource = false; @@ -1900,7 +1900,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.api.chatviews.get(contact_jid); spyOn(view.model, 'sendMessage').and.callThrough(); @@ -1908,9 +1908,9 @@ let stanza = u.toStanza(` + to="romeo@montague.lit/orchard"> Have you heard this funny audio? - https://localhost/audio.mp3 + https://montague.lit/audio.mp3 `) _converse.connection._dataRecv(test_utils.createRequest(stanza)); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); @@ -1922,16 +1922,16 @@ let media = view.el.querySelector('.chat-msg .chat-msg__media'); expect(media.innerHTML.replace(/(\r\n|\n|\r)/gm, "")).toEqual( ''+ - ''+ - 'Download audio file "audio.mp3"'); + ''+ + 'Download audio file "audio.mp3"'); // If the and contents is the same, don't duplicate. stanza = u.toStanza(` - https://localhost/audio.mp3 - https://localhost/audio.mp3 + to="romeo@montague.lit/orchard"> + https://montague.lit/audio.mp3 + https://montague.lit/audio.mp3 `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); @@ -1940,8 +1940,8 @@ media = view.el.querySelector('.chat-msg:last-child .chat-msg__media'); expect(media.innerHTML.replace(/(\r\n|\n|\r)/gm, "")).toEqual( ''+ - ''+ - 'Download audio file "audio.mp3"' + ''+ + 'Download audio file "audio.mp3"' ); done(); })); @@ -1952,7 +1952,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) const view = _converse.api.chatviews.get(contact_jid); spyOn(view.model, 'sendMessage').and.callThrough(); @@ -1960,9 +1960,9 @@ let stanza = u.toStanza(` + to="romeo@montague.lit/orchard"> Have you seen this funny video? - https://localhost/video.mp4 + https://montague.lit/video.mp4 `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); await test_utils.waitUntil(() => view.el.querySelectorAll('.chat-content .chat-msg video').length, 2000) @@ -1972,16 +1972,16 @@ let media = view.el.querySelector('.chat-msg .chat-msg__media'); expect(media.innerHTML.replace(/(\r\n|\n|\r)/gm, "")).toEqual( ''+ - ''+ - 'Download video file "video.mp4"'); + ''+ + 'Download video file "video.mp4"'); // If the and contents is the same, don't duplicate. stanza = u.toStanza(` - https://localhost/video.mp4 - https://localhost/video.mp4 + to="romeo@montague.lit/orchard"> + https://montague.lit/video.mp4 + https://montague.lit/video.mp4 `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); @@ -1990,8 +1990,8 @@ media = view.el.querySelector('.chat-msg:last-child .chat-msg__media'); expect(media.innerHTML.replace(/(\r\n|\n|\r)/gm, "")).toEqual( ''+ - ''+ - 'Download video file "video.mp4"'); + ''+ + 'Download video file "video.mp4"'); done(); })); @@ -2001,16 +2001,16 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.api.chatviews.get(contact_jid); spyOn(view.model, 'sendMessage').and.callThrough(); const stanza = u.toStanza(` + to="romeo@montague.lit/orchard"> Have you downloaded this funny file? - https://localhost/funny.pdf + https://montague.lit/funny.pdf `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); @@ -2021,7 +2021,7 @@ const media = view.el.querySelector('.chat-msg .chat-msg__media'); expect(media.innerHTML.replace(/(\r\n|\n|\r)/gm, "")).toEqual( ''+ - 'Download file "funny.pdf"'); + 'Download file "funny.pdf"'); done(); })); @@ -2032,7 +2032,7 @@ const base_url = 'https://conversejs.org'; await test_utils.waitForRoster(_converse, 'current', 1); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) const view = _converse.api.chatviews.get(contact_jid); spyOn(view.model, 'sendMessage').and.callThrough(); @@ -2041,7 +2041,7 @@ const stanza = u.toStanza(` + to="romeo@montague.lit/orchard"> Have you seen this funny image? ${url} `); @@ -2070,7 +2070,7 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current', 1); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.api.chatviews.get(contact_jid); const msgid = u.getUniqueId(); @@ -2089,7 +2089,7 @@ _converse.connection._dataRecv(test_utils.createRequest(stanza)); await test_utils.waitUntil(() => view.model.sendMarker.calls.count() === 1); expect(Strophe.serialize(sent_stanzas[0])).toBe( - ``+ ``+ @@ -2103,7 +2103,7 @@ async function (done, _converse) { _converse.api.trigger('rosterContactsFetched'); - const contact_jid = 'someone@localhost'; + const contact_jid = 'someone@montague.lit'; const msgid = u.getUniqueId(); const stanza = u.toStanza(` `+ + ``+ ``+ ``+ ``+ @@ -2141,7 +2141,7 @@ await test_utils.waitForRoster(_converse, 'current', 1); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, [], [Strophe.NS.SID]); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const view = _converse.api.chatviews.get(contact_jid); @@ -2190,15 +2190,15 @@ null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.api.chatviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.api.chatviews.get('lounge@montague.lit'); if (!view.el.querySelectorAll('.chat-area').length) { view.renderChatArea(); } - const message = 'dummy: Your attention is required'; + const message = 'romeo: Your attention is required'; const nick = mock.chatroom_names[0], msg = $msg({ - from: 'lounge@localhost/'+nick, + from: 'lounge@montague.lit/'+nick, id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t(message).tree(); await view.model.onMessage(msg); @@ -2212,14 +2212,14 @@ null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); if (!view.el.querySelectorAll('.chat-area').length) { view.renderChatArea(); } const id = u.getUniqueId(); let msg = $msg({ - from: 'lounge@localhost/some1', + from: 'lounge@montague.lit/some1', id: id, - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t('First message').tree(); await view.model.onMessage(msg); @@ -2227,9 +2227,9 @@ expect(view.el.querySelectorAll('.chat-msg').length).toBe(1); msg = $msg({ - from: 'lounge@localhost/some2', + from: 'lounge@montague.lit/some2', id: id, - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t('Another message').tree(); await view.model.onMessage(msg); @@ -2243,7 +2243,7 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'room', 'muc.example.com', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'room', 'muc.example.com', 'romeo'); const view = _converse.chatboxviews.get('room@muc.example.com'); spyOn(view.model, 'findDuplicateFromStanzaID').and.callThrough(); let stanza = u.toStanza(` @@ -2288,12 +2288,12 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.api.chatviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.api.chatviews.get('lounge@montague.lit'); let msg = $msg({ - from: 'lounge@localhost/dummy', + from: 'lounge@montague.lit/romeo', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t('I wrote this message!').tree(); await view.model.onMessage(msg); @@ -2304,13 +2304,13 @@ expect(sizzle('.chat-msg__author', view.el).pop().classList.value.trim()).toBe('chat-msg__author chat-msg__me moderator'); let presence = $pres({ - to:'dummy@localhost/resource', - from:'lounge@localhost/dummy', + to:'romeo@montague.lit/orchard', + from:'lounge@montague.lit/romeo', id: u.getUniqueId() }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc#user'}) .c('item').attrs({ affiliation: 'member', - jid: 'dummy@localhost/resource', + jid: 'romeo@montague.lit/orchard', role: 'participant' }).up() .c('status').attrs({code:'110'}).up() @@ -2318,9 +2318,9 @@ _converse.connection._dataRecv(test_utils.createRequest(presence)); msg = $msg({ - from: 'lounge@localhost/dummy', + from: 'lounge@montague.lit/romeo', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t('Another message!').tree(); await view.model.onMessage(msg); @@ -2331,13 +2331,13 @@ expect(sizzle('.chat-msg__author', view.el).pop().classList.value.trim()).toBe('chat-msg__author chat-msg__me participant'); presence = $pres({ - to:'dummy@localhost/resource', - from:'lounge@localhost/dummy', + to:'romeo@montague.lit/orchard', + from:'lounge@montague.lit/romeo', id: u.getUniqueId() }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc#user'}) .c('item').attrs({ affiliation: 'owner', - jid: 'dummy@localhost/resource', + jid: 'romeo@montague.lit/orchard', role: 'moderator' }).up() .c('status').attrs({code:'110'}).up() @@ -2358,12 +2358,12 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.api.chatviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.api.chatviews.get('lounge@montague.lit'); const msg = $msg({ - from: 'lounge@localhost/dummy', + from: 'lounge@montague.lit/romeo', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t('I wrote this message!').tree(); await view.model.onMessage(msg); @@ -2377,24 +2377,24 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const jid = 'lounge@localhost'; + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const jid = 'lounge@montague.lit'; const room = _converse.api.rooms.get(jid); const view = _converse.api.chatviews.get(jid); const stanza = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/newguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }).tree(); _converse.connection._dataRecv(test_utils.createRequest(stanza)); const msg_id = u.getUniqueId(); await view.model.onMessage($msg({ - 'from': 'lounge@localhost/newguy', + 'from': 'lounge@montague.lit/newguy', 'to': _converse.connection.jid, 'type': 'groupchat', 'id': msg_id, @@ -2405,7 +2405,7 @@ .toBe('But soft, what light through yonder airlock breaks?'); await view.model.onMessage($msg({ - 'from': 'lounge@localhost/newguy', + 'from': 'lounge@montague.lit/newguy', 'to': _converse.connection.jid, 'type': 'groupchat', 'id': u.getUniqueId(), @@ -2417,7 +2417,7 @@ expect(view.el.querySelectorAll('.chat-msg__content .fa-edit').length).toBe(1); await view.model.onMessage($msg({ - 'from': 'lounge@localhost/newguy', + 'from': 'lounge@montague.lit/newguy', 'to': _converse.connection.jid, 'type': 'groupchat', 'id': u.getUniqueId(), @@ -2445,8 +2445,8 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const room_jid = 'lounge@localhost'; + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const room_jid = 'lounge@montague.lit'; const room = _converse.api.rooms.get(room_jid); const view = _converse.api.chatviews.get(room_jid); const textarea = view.el.querySelector('textarea.chat-textarea'); @@ -2492,8 +2492,8 @@ const msg = _converse.connection.send.calls.all()[0].args[0]; expect(msg.toLocaleString()) - .toBe(``+ `But soft, what light through yonder window breaks?`+ ``+ @@ -2518,7 +2518,7 @@ await view.model.onMessage($msg({ 'from': room_jid+'/someone-else', 'id': (new Date()).getTime(), - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'type': 'groupchat' }).c('body').t('Hello world').tree()); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); @@ -2552,8 +2552,8 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); const textarea = view.el.querySelector('textarea.chat-textarea'); textarea.value = 'But soft, what light through yonder airlock breaks?'; view.onKeyDown({ @@ -2571,7 +2571,7 @@ ${msg_obj.get('message')} + by="lounge@montague.lit"/> `); await view.model.onMessage(stanza); @@ -2580,7 +2580,7 @@ expect(view.model.messages.length).toBe(1); const message = view.model.messages.at(0); - expect(message.get('stanza_id lounge@localhost')).toBe('5f3dbc5e-e1d3-4077-a492-693f3769c7ad'); + expect(message.get('stanza_id lounge@montague.lit')).toBe('5f3dbc5e-e1d3-4077-a492-693f3769c7ad'); expect(message.get('origin_id')).toBe(msg_obj.get('origin_id')); done(); })); @@ -2590,7 +2590,7 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'room', 'muc.example.com', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'room', 'muc.example.com', 'romeo'); const view = _converse.chatboxviews.get('room@muc.example.com'); view.model.sendMessage('hello world'); @@ -2602,7 +2602,7 @@ const stanza = u.toStanza(` Hello world @@ -2626,8 +2626,8 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); const textarea = view.el.querySelector('textarea.chat-textarea'); textarea.value = 'But soft, what light through yonder airlock breaks?'; view.onKeyDown({ @@ -2640,8 +2640,8 @@ const msg_obj = view.model.messages.at(0); const stanza = u.toStanza(` - + `); @@ -2661,8 +2661,8 @@ async function (done, _converse) { await test_utils.waitForRoster(_converse, 'current'); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); const textarea = view.el.querySelector('textarea.chat-textarea'); textarea.value = 'But soft, what light through yonder airlock breaks?'; view.onKeyDown({ @@ -2677,8 +2677,8 @@ const msg_obj = view.model.messages.at(0); let stanza = u.toStanza(` - + `); spyOn(view.model, "isChatMarker").and.callThrough(); @@ -2688,8 +2688,8 @@ expect(view.el.querySelectorAll('.chat-msg__receipt').length).toBe(0); stanza = u.toStanza(` - + `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -2698,8 +2698,8 @@ expect(view.el.querySelectorAll('.chat-msg__receipt').length).toBe(0); stanza = u.toStanza(` - + `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -2709,8 +2709,8 @@ expect(view.el.querySelectorAll('.chat-msg__receipt').length).toBe(0); stanza = u.toStanza(` - + 'tis I! `); @@ -2728,31 +2728,31 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'tom'); - const view = _converse.api.chatviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'tom'); + const view = _converse.api.chatviews.get('lounge@montague.lit'); ['z3r0', 'mr.robot', 'gibson', 'sw0rdf1sh'].forEach((nick) => { _converse.connection._dataRecv(test_utils.createRequest( $pres({ - 'to': 'tom@localhost/resource', - 'from': `lounge@localhost/${nick}` + 'to': 'tom@montague.lit/resource', + 'from': `lounge@montague.lit/${nick}` }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': `${nick}@localhost/resource`, + 'jid': `${nick}@montague.lit/resource`, 'role': 'participant' })) ); }); const msg = $msg({ - from: 'lounge@localhost/gibson', + from: 'lounge@montague.lit/gibson', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t('hello z3r0 tom mr.robot, how are you?').up() - .c('reference', {'xmlns':'urn:xmpp:reference:0', 'begin':'6', 'end':'10', 'type':'mention', 'uri':'xmpp:z3r0@localhost'}).up() - .c('reference', {'xmlns':'urn:xmpp:reference:0', 'begin':'11', 'end':'14', 'type':'mention', 'uri':'xmpp:dummy@localhost'}).up() - .c('reference', {'xmlns':'urn:xmpp:reference:0', 'begin':'15', 'end':'23', 'type':'mention', 'uri':'xmpp:mr.robot@localhost'}).nodeTree; + .c('reference', {'xmlns':'urn:xmpp:reference:0', 'begin':'6', 'end':'10', 'type':'mention', 'uri':'xmpp:z3r0@montague.lit'}).up() + .c('reference', {'xmlns':'urn:xmpp:reference:0', 'begin':'11', 'end':'14', 'type':'mention', 'uri':'xmpp:romeo@montague.lit'}).up() + .c('reference', {'xmlns':'urn:xmpp:reference:0', 'begin':'15', 'end':'23', 'type':'mention', 'uri':'xmpp:mr.robot@montague.lit'}).nodeTree; await view.model.onMessage(msg); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); const messages = view.el.querySelectorAll('.chat-msg__text'); @@ -2773,18 +2773,18 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'tom'); - const view = _converse.api.chatviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'tom'); + const view = _converse.api.chatviews.get('lounge@montague.lit'); ['z3r0', 'mr.robot', 'gibson', 'sw0rdf1sh', 'Link Mauve'].forEach((nick) => { _converse.connection._dataRecv(test_utils.createRequest( $pres({ - 'to': 'tom@localhost/resource', - 'from': `lounge@localhost/${nick}` + 'to': 'tom@montague.lit/resource', + 'from': `lounge@montague.lit/${nick}` }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': `${nick.replace(/\s/g, '-')}@localhost/resource`, + 'jid': `${nick.replace(/\s/g, '-')}@montague.lit/resource`, 'role': 'participant' }))); }); @@ -2798,14 +2798,14 @@ expect(references.length).toBe(1); expect(text).toBe('hello z3r0'); expect(JSON.stringify(references)) - .toBe('[{"begin":6,"end":10,"value":"z3r0","type":"mention","uri":"xmpp:z3r0@localhost"}]'); + .toBe('[{"begin":6,"end":10,"value":"z3r0","type":"mention","uri":"xmpp:z3r0@montague.lit"}]'); [text, references] = view.model.parseTextForReferences('hello @some1 @z3r0 @gibson @mr.robot, how are you?') expect(text).toBe('hello @some1 z3r0 gibson mr.robot, how are you?'); expect(JSON.stringify(references)) - .toBe('[{"begin":13,"end":17,"value":"z3r0","type":"mention","uri":"xmpp:z3r0@localhost"},'+ - '{"begin":18,"end":24,"value":"gibson","type":"mention","uri":"xmpp:gibson@localhost"},'+ - '{"begin":25,"end":33,"value":"mr.robot","type":"mention","uri":"xmpp:mr.robot@localhost"}]'); + .toBe('[{"begin":13,"end":17,"value":"z3r0","type":"mention","uri":"xmpp:z3r0@montague.lit"},'+ + '{"begin":18,"end":24,"value":"gibson","type":"mention","uri":"xmpp:gibson@montague.lit"},'+ + '{"begin":25,"end":33,"value":"mr.robot","type":"mention","uri":"xmpp:mr.robot@montague.lit"}]'); [text, references] = view.model.parseTextForReferences('yo @gib') expect(text).toBe('yo @gib'); @@ -2819,13 +2819,13 @@ expect(text).toBe('gibson'); expect(references.length).toBe(1); expect(JSON.stringify(references)) - .toBe('[{"begin":0,"end":6,"value":"gibson","type":"mention","uri":"xmpp:gibson@localhost"}]'); + .toBe('[{"begin":0,"end":6,"value":"gibson","type":"mention","uri":"xmpp:gibson@montague.lit"}]'); [text, references] = view.model.parseTextForReferences('hi @Link Mauve how are you?') expect(text).toBe('hi Link Mauve how are you?'); expect(references.length).toBe(1); expect(JSON.stringify(references)) - .toBe('[{"begin":3,"end":13,"value":"Link Mauve","type":"mention","uri":"xmpp:Link-Mauve@localhost"}]'); + .toBe('[{"begin":3,"end":13,"value":"Link Mauve","type":"mention","uri":"xmpp:Link-Mauve@montague.lit"}]'); [text, references] = view.model.parseTextForReferences('https://example.org/@gibson') expect(text).toBe('https://example.org/@gibson'); @@ -2854,18 +2854,18 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'tom'); - const view = _converse.api.chatviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'tom'); + const view = _converse.api.chatviews.get('lounge@montague.lit'); ['NotAnAdress', 'darnuria'].forEach((nick) => { _converse.connection._dataRecv(test_utils.createRequest( $pres({ - 'to': 'tom@localhost/resource', - 'from': `lounge@localhost/${nick}` + 'to': 'tom@montague.lit/resource', + 'from': `lounge@montague.lit/${nick}` }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': `${nick.replace(/\s/g, '-')}@localhost/resource`, + 'jid': `${nick.replace(/\s/g, '-')}@montague.lit/resource`, 'role': 'participant' }))); }); @@ -2888,18 +2888,18 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'tom'); - const view = _converse.api.chatviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'tom'); + const view = _converse.api.chatviews.get('lounge@montague.lit'); ['z3r0', 'mr.robot', 'gibson', 'sw0rdf1sh'].forEach((nick) => { _converse.connection._dataRecv(test_utils.createRequest( $pres({ - 'to': 'tom@localhost/resource', - 'from': `lounge@localhost/${nick}` + 'to': 'tom@montague.lit/resource', + 'from': `lounge@montague.lit/${nick}` }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': `${nick}@localhost/resource`, + 'jid': `${nick}@montague.lit/resource`, 'role': 'participant' }))); }); @@ -2917,14 +2917,14 @@ await new Promise((resolve, reject) => view.once('messageInserted', resolve)); const msg = _converse.connection.send.calls.all()[0].args[0]; expect(msg.toLocaleString()) - .toBe(``+ `hello z3r0 gibson mr.robot, how are you?`+ ``+ - ``+ - ``+ - ``+ + ``+ + ``+ + ``+ ``+ ``); @@ -2945,14 +2945,14 @@ const correction = _converse.connection.send.calls.all()[1].args[0]; expect(correction.toLocaleString()) - .toBe(``+ `hello z3r0 gibson sw0rdf1sh, how are you?`+ ``+ - ``+ - ``+ - ``+ + ``+ + ``+ + ``+ ``+ ``+ ``); @@ -2964,18 +2964,18 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'tom'); - const view = _converse.api.chatviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'tom'); + const view = _converse.api.chatviews.get('lounge@montague.lit'); ['z3r0', 'mr.robot', 'gibson', 'sw0rdf1sh'].forEach((nick) => { _converse.connection._dataRecv(test_utils.createRequest( $pres({ - 'to': 'tom@localhost/resource', - 'from': `lounge@localhost/${nick}` + 'to': 'tom@montague.lit/resource', + 'from': `lounge@montague.lit/${nick}` }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': `${nick}@localhost/resource`, + 'jid': `${nick}@montague.lit/resource`, 'role': 'participant' }))); }); @@ -2993,14 +2993,14 @@ const msg = _converse.connection.send.calls.all()[0].args[0]; expect(msg.toLocaleString()) - .toBe(``+ `hello z3r0 gibson mr.robot, how are you?`+ ``+ - ``+ - ``+ - ``+ + ``+ + ``+ + ``+ ``+ ``); done(); diff --git a/spec/minchats.js b/spec/minchats.js index bf4d18093..acf7872ee 100644 --- a/spec/minchats.js +++ b/spec/minchats.js @@ -20,7 +20,7 @@ _converse.minimized_chats.toggleview.model.browserStorage._clear(); _converse.minimized_chats.initToggle(); - let contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + let contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) let chatview = _converse.chatboxviews.get(contact_jid); expect(chatview.model.get('minimized')).toBeFalsy(); @@ -31,7 +31,7 @@ expect(_converse.minimized_chats.keys().length).toBe(1); expect(_converse.minimized_chats.keys()[0]).toBe(contact_jid); - contact_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; + contact_jid = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); chatview = _converse.chatboxviews.get(contact_jid); expect(chatview.model.get('minimized')).toBeFalsy(); @@ -55,7 +55,7 @@ _converse.minimized_chats.toggleview.model.browserStorage._clear(); _converse.minimized_chats.initToggle(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid); const chatview = _converse.chatboxviews.get(contact_jid); expect(u.isVisible(_converse.minimized_chats.el)).toBeFalsy(); @@ -90,7 +90,7 @@ expect(_.isNull(unread_el)).toBe(true); for (i=0; i<3; i++) { - contact_jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost'; + contact_jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@montague.lit'; test_utils.openChatBoxFor(_converse, contact_jid); } test_utils.waitUntil(() => _converse.chatboxes.length == 4).then(() => { @@ -161,13 +161,13 @@ var view = _converse.chatboxviews.get(room_jid); view.model.set({'minimized': true}); - var contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost'; + var contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@montague.lit'; var message = 'fires: Your attention is required'; var nick = mock.chatroom_names[0], msg = $msg({ from: room_jid+'/'+nick, id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t(message).tree(); view.model.onMessage(msg); diff --git a/spec/muc.js b/spec/muc.js index 61af471c5..06c70a207 100644 --- a/spec/muc.js +++ b/spec/muc.js @@ -21,29 +21,29 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - await test_utils.openAndEnterChatRoom(_converse, 'leisure', 'localhost', 'dummy'); - await test_utils.openAndEnterChatRoom(_converse, 'news', 'localhost', 'dummy'); - expect(u.isVisible(_converse.chatboxviews.get('lounge@localhost').el)).toBeTruthy(); - expect(u.isVisible(_converse.chatboxviews.get('leisure@localhost').el)).toBeTruthy(); - expect(u.isVisible(_converse.chatboxviews.get('news@localhost').el)).toBeTruthy(); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + await test_utils.openAndEnterChatRoom(_converse, 'leisure', 'montague.lit', 'romeo'); + await test_utils.openAndEnterChatRoom(_converse, 'news', 'montague.lit', 'romeo'); + expect(u.isVisible(_converse.chatboxviews.get('lounge@montague.lit').el)).toBeTruthy(); + expect(u.isVisible(_converse.chatboxviews.get('leisure@montague.lit').el)).toBeTruthy(); + expect(u.isVisible(_converse.chatboxviews.get('news@montague.lit').el)).toBeTruthy(); - _converse.api.roomviews.close('lounge@localhost'); - expect(_converse.chatboxviews.get('lounge@localhost')).toBeUndefined(); - expect(u.isVisible(_converse.chatboxviews.get('leisure@localhost').el)).toBeTruthy(); - expect(u.isVisible(_converse.chatboxviews.get('news@localhost').el)).toBeTruthy(); + _converse.api.roomviews.close('lounge@montague.lit'); + expect(_converse.chatboxviews.get('lounge@montague.lit')).toBeUndefined(); + expect(u.isVisible(_converse.chatboxviews.get('leisure@montague.lit').el)).toBeTruthy(); + expect(u.isVisible(_converse.chatboxviews.get('news@montague.lit').el)).toBeTruthy(); - _converse.api.roomviews.close(['leisure@localhost', 'news@localhost']); - expect(_converse.chatboxviews.get('lounge@localhost')).toBeUndefined(); - expect(_converse.chatboxviews.get('leisure@localhost')).toBeUndefined(); - expect(_converse.chatboxviews.get('news@localhost')).toBeUndefined(); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - await test_utils.openAndEnterChatRoom(_converse, 'leisure', 'localhost', 'dummy'); - expect(u.isVisible(_converse.chatboxviews.get('lounge@localhost').el)).toBeTruthy(); - expect(u.isVisible(_converse.chatboxviews.get('leisure@localhost').el)).toBeTruthy(); + _converse.api.roomviews.close(['leisure@montague.lit', 'news@montague.lit']); + expect(_converse.chatboxviews.get('lounge@montague.lit')).toBeUndefined(); + expect(_converse.chatboxviews.get('leisure@montague.lit')).toBeUndefined(); + expect(_converse.chatboxviews.get('news@montague.lit')).toBeUndefined(); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + await test_utils.openAndEnterChatRoom(_converse, 'leisure', 'montague.lit', 'romeo'); + expect(u.isVisible(_converse.chatboxviews.get('lounge@montague.lit').el)).toBeTruthy(); + expect(u.isVisible(_converse.chatboxviews.get('leisure@montague.lit').el)).toBeTruthy(); _converse.api.roomviews.close(); - expect(_converse.chatboxviews.get('lounge@localhost')).toBeUndefined(); - expect(_converse.chatboxviews.get('leisure@localhost')).toBeUndefined(); + expect(_converse.chatboxviews.get('lounge@montague.lit')).toBeUndefined(); + expect(_converse.chatboxviews.get('leisure@montague.lit')).toBeUndefined(); done(); })); @@ -54,8 +54,8 @@ test_utils.createContacts(_converse, 'current'); await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group .group-toggle').length, 300); - await test_utils.openAndEnterChatRoom(_converse, 'chillout', 'localhost', 'dummy'); - let jid = 'chillout@localhost'; + await test_utils.openAndEnterChatRoom(_converse, 'chillout', 'montague.lit', 'romeo'); + let jid = 'chillout@montague.lit'; let room = _converse.api.rooms.get(jid); expect(room instanceof Object).toBeTruthy(); @@ -66,20 +66,20 @@ chatroomview.close(); // Test with mixed case - await test_utils.openAndEnterChatRoom(_converse, 'Leisure', 'localhost', 'dummy'); - jid = 'Leisure@localhost'; + await test_utils.openAndEnterChatRoom(_converse, 'Leisure', 'montague.lit', 'romeo'); + jid = 'Leisure@montague.lit'; room = _converse.api.rooms.get(jid); expect(room instanceof Object).toBeTruthy(); chatroomview = _converse.chatboxviews.get(jid.toLowerCase()); expect(u.isVisible(chatroomview.el)).toBeTruthy(); - jid = 'leisure@localhost'; + jid = 'leisure@montague.lit'; room = _converse.api.rooms.get(jid); expect(room instanceof Object).toBeTruthy(); chatroomview = _converse.chatboxviews.get(jid.toLowerCase()); expect(u.isVisible(chatroomview.el)).toBeTruthy(); - jid = 'leiSure@localhost'; + jid = 'leiSure@montague.lit'; room = _converse.api.rooms.get(jid); expect(room instanceof Object).toBeTruthy(); chatroomview = _converse.chatboxviews.get(jid.toLowerCase()); @@ -87,7 +87,7 @@ chatroomview.close(); // Non-existing room - jid = 'chillout2@localhost'; + jid = 'chillout2@montague.lit'; room = _converse.api.rooms.get(jid); expect(typeof room === 'undefined').toBeTruthy(); done(); @@ -104,7 +104,7 @@ spyOn(_converse.ChatRoom.prototype, 'getRoomFeatures').and.callFake(() => Promise.resolve()); const sent_IQ_els = []; - let jid = 'lounge@localhost'; + let jid = 'lounge@montague.lit'; let chatroomview, sent_IQ, IQ_id; test_utils.openControlBox(); test_utils.createContacts(_converse, 'current'); @@ -125,19 +125,19 @@ chatroomview.close(); // Test with mixed case in JID - jid = 'Leisure@localhost'; + jid = 'Leisure@montague.lit'; room = await _converse.api.rooms.open(jid); expect(room instanceof Backbone.Model).toBeTruthy(); chatroomview = _converse.chatboxviews.get(jid.toLowerCase()); await test_utils.waitUntil(() => u.isVisible(chatroomview.el)); - jid = 'leisure@localhost'; + jid = 'leisure@montague.lit'; room = await _converse.api.rooms.open(jid); expect(room instanceof Backbone.Model).toBeTruthy(); chatroomview = _converse.chatboxviews.get(jid.toLowerCase()); await test_utils.waitUntil(() => u.isVisible(chatroomview.el)); - jid = 'leiSure@localhost'; + jid = 'leiSure@montague.lit'; room = await _converse.api.rooms.open(jid); expect(room instanceof Backbone.Model).toBeTruthy(); chatroomview = _converse.chatboxviews.get(jid.toLowerCase()); @@ -169,15 +169,15 @@ const features_stanza = $iq({ from: 'room@conference.example.org', 'id': IQ_id, - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'error' }).c('error', {'type': 'cancel'}) .c('item-not-found', {'xmlns': "urn:ietf:params:xml:ns:xmpp-stanzas"}); _converse.connection._dataRecv(test_utils.createRequest(features_stanza)); - /* + /* * - * + * * * * @@ -185,12 +185,12 @@ */ const presence = $pres({ from:'room@conference.example.org/some1', - to:'dummy@localhost/pda' + to:'romeo@montague.lit/pda' }) .c('x', {xmlns:'http://jabber.org/protocol/muc#user'}) .c('item', { affiliation: 'owner', - jid: 'dummy@localhost/pda', + jid: 'romeo@montague.lit/pda', role: 'moderator' }).up() .c('status', {code:'110'}).up() @@ -207,7 +207,7 @@ const node = u.toStanza(` @@ -269,17 +269,17 @@ const IQ_stanzas = _converse.connection.IQ_stanzas; const sendIQ = _converse.connection.sendIQ; - const room_jid = 'lounge@localhost'; + const room_jid = 'lounge@montague.lit'; let sent_IQ, IQ_id; spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) { - if (iq.nodeTree.getAttribute('to') === 'lounge@localhost') { + if (iq.nodeTree.getAttribute('to') === 'lounge@montague.lit') { sent_IQ = iq; IQ_id = sendIQ.bind(this)(iq, callback, errback); } else { sendIQ.bind(this)(iq, callback, errback); } }); - await test_utils.openChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); let stanza = await test_utils.waitUntil(() => _.filter( IQ_stanzas, iq => iq.querySelector( @@ -297,15 +297,15 @@ * */ const features_stanza = $iq({ - 'from': 'lounge@localhost', + 'from': 'lounge@montague.lit', 'id': stanza.getAttribute('id'), - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'error' }).c('error', {'type': 'cancel'}) .c('item-not-found', {'xmlns': "urn:ietf:params:xml:ns:xmpp-stanzas"}); _converse.connection._dataRecv(test_utils.createRequest(features_stanza)); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view.model, 'join').and.callThrough(); /* `+ ``); @@ -358,13 +358,13 @@ * */ const presence = $pres({ - to:'dummy@localhost/resource', - from:'lounge@localhost/thirdwitch', + to:'romeo@montague.lit/orchard', + from:'lounge@montague.lit/thirdwitch', id:'5025e055-036c-4bc5-a227-706e7e352053' }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc#user'}) .c('item').attrs({ affiliation: 'owner', - jid: 'dummy@localhost/resource', + jid: 'romeo@montague.lit/orchard', role: 'moderator' }).up() .c('status').attrs({code:'110'}).up() @@ -383,7 +383,7 @@ */ const iq = IQ_stanzas.filter(s => s.querySelector(`query[xmlns="${Strophe.NS.MUC_OWNER}"]`)).pop(); expect(Strophe.serialize(iq)).toBe( - ``+ + ``+ ``+ ``); done(); @@ -397,14 +397,14 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.waitUntil(() => test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy')); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.waitUntil(() => test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo')); + const view = _converse.chatboxviews.get('lounge@montague.lit'); const message = 'Hello world', nick = mock.chatroom_names[0], msg = $msg({ - 'from': 'lounge@localhost/'+nick, + 'from': 'lounge@montague.lit/'+nick, 'id': (new Date()).getTime(), - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'type': 'groupchat' }).c('body').t(message).tree(); @@ -425,8 +425,8 @@ async function (done, _converse) { test_utils.createContacts(_converse, 'current'); - await test_utils.waitUntil(() => test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy')); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.waitUntil(() => test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo')); + const view = _converse.chatboxviews.get('lounge@montague.lit'); if (!view.el.querySelectorAll('.chat-area').length) { view.renderChatArea(); } @@ -434,9 +434,9 @@ const message = 'Please go to xmpp:coven@chat.shakespeare.lit?join', nick = mock.chatroom_names[0], msg = $msg({ - 'from': 'lounge@localhost/'+nick, + 'from': 'lounge@montague.lit/'+nick, 'id': (new Date()).getTime(), - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'type': 'groupchat' }).c('body').t(message).tree(); @@ -456,22 +456,22 @@ await test_utils.openChatRoom(_converse, "coven", 'chat.shakespeare.lit'); const view = _converse.chatboxviews.get('coven@chat.shakespeare.lit'); const chat_content = view.el.querySelector('.chat-content'); - /* * - * + * * * * * */ let presence = $pres({ - to: 'dummy@localhost/resource', + to: 'romeo@montague.lit/orchard', from: 'coven@chat.shakespeare.lit/some1' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'owner', - 'jid': 'dummy@localhost/_converse.js-29092160', + 'jid': 'romeo@montague.lit/_converse.js-29092160', 'role': 'moderator' }).up() .c('status', {code: '110'}).up() @@ -486,12 +486,12 @@ // Check that we don't show the notification twice presence = $pres({ - to: 'dummy@localhost/resource', + to: 'romeo@montague.lit/orchard', from: 'coven@chat.shakespeare.lit/some1' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'owner', - 'jid': 'dummy@localhost/_converse.js-29092160', + 'jid': 'romeo@montague.lit/_converse.js-29092160', 'role': 'moderator' }).up() .c('status', {code: '110'}).up() @@ -519,32 +519,32 @@ * receive our own. */ let presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/oldguy' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'oldguy@localhost/_converse.js-290929789', + 'jid': 'oldguy@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); expect(chat_content.querySelectorAll('div.chat-info').length).toBe(0); - /* * - * + * * * * */ presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/some1' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'owner', - 'jid': 'dummy@localhost/_converse.js-29092160', + 'jid': 'romeo@montague.lit/_converse.js-29092160', 'role': 'moderator' }).up() .c('status', {code: '110'}); @@ -553,13 +553,13 @@ .toBe("some1 has entered the groupchat"); presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/newguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -570,7 +570,7 @@ const msg = $msg({ 'from': 'coven@chat.shakespeare.lit/some1', 'id': (new Date()).getTime(), - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'type': 'groupchat' }).c('body').t('hello world').tree(); _converse.connection._dataRecv(test_utils.createRequest(msg)); @@ -579,13 +579,13 @@ // Add another entrant, otherwise the above message will be // collapsed if "newguy" leaves immediately again presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/newgirl' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newgirl@localhost/_converse.js-213098781', + 'jid': 'newgirl@montague.lit/_converse.js-213098781', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -595,12 +595,12 @@ // Don't show duplicate join messages presence = $pres({ - to: 'dummy@localhost/_converse.js-290918392', + to: 'romeo@montague.lit/_converse.js-290918392', from: 'coven@chat.shakespeare.lit/newguy' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -619,7 +619,7 @@ * */ presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', type: 'unavailable', from: 'coven@chat.shakespeare.lit/newguy' }) @@ -627,7 +627,7 @@ .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'none' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -639,12 +639,12 @@ // When the user immediately joins again, we collapse the // multiple join/leave messages. presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/newguy' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -654,14 +654,14 @@ expect(msg_el.getAttribute('data-leavejoin')).toBe('newguy'); presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', type: 'unavailable', from: 'coven@chat.shakespeare.lit/newguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'none' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -671,13 +671,13 @@ expect(msg_el.getAttribute('data-leave')).toBe('newguy'); presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/nomorenicks' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'nomorenicks@localhost/_converse.js-290929789', + 'jid': 'nomorenicks@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -686,13 +686,13 @@ .toBe("nomorenicks has entered the groupchat"); presence = $pres({ - to: 'dummy@localhost/_converse.js-290918392', + to: 'romeo@montague.lit/_converse.js-290918392', type: 'unavailable', from: 'coven@chat.shakespeare.lit/nomorenicks' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'nomorenicks@localhost/_converse.js-290929789', + 'jid': 'nomorenicks@montague.lit/_converse.js-290929789', 'role': 'none' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -701,13 +701,13 @@ .toBe("nomorenicks has entered and left the groupchat"); presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/nomorenicks' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'nomorenicks@localhost/_converse.js-290929789', + 'jid': 'nomorenicks@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -717,12 +717,12 @@ // Test a member joining and leaving presence = $pres({ - to: 'dummy@localhost/_converse.js-290918392', + to: 'romeo@montague.lit/_converse.js-290918392', from: 'coven@chat.shakespeare.lit/insider' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'member', - 'jid': 'insider@localhost/_converse.js-290929789', + 'jid': 'insider@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -741,7 +741,7 @@ * */ presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', type: 'unavailable', from: 'coven@chat.shakespeare.lit/insider' }) @@ -749,7 +749,7 @@ .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'member', - 'jid': 'insider@localhost/_converse.js-290929789', + 'jid': 'insider@montague.lit/_converse.js-290929789', 'role': 'none' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -759,18 +759,18 @@ '"Disconnected: Replaced by new connection"'); expect(view.model.occupants.length).toBe(5); - expect(view.model.occupants.findWhere({'jid': 'insider@localhost'}).get('show')).toBe('offline'); + expect(view.model.occupants.findWhere({'jid': 'insider@montague.lit'}).get('show')).toBe('offline'); // New girl leaves presence = $pres({ - 'to': 'dummy@localhost/_converse.js-29092160', + 'to': 'romeo@montague.lit/_converse.js-29092160', 'type': 'unavailable', 'from': 'coven@chat.shakespeare.lit/newgirl' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newgirl@localhost/_converse.js-213098781', + 'jid': 'newgirl@montague.lit/_converse.js-213098781', 'role': 'none' }); @@ -786,15 +786,15 @@ null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'coven', 'chat.shakespeare.lit', 'dummy') + await test_utils.openAndEnterChatRoom(_converse, 'coven', 'chat.shakespeare.lit', 'romeo') const view = _converse.chatboxviews.get('coven@chat.shakespeare.lit'); const chat_content = view.el.querySelector('.chat-content'); expect(sizzle('div.chat-info', chat_content).length).toBe(1); - expect(sizzle('div.chat-info:last', chat_content).pop().textContent).toBe("dummy has entered the groupchat"); + expect(sizzle('div.chat-info:last', chat_content).pop().textContent).toBe("romeo has entered the groupchat"); let presence = u.toStanza( - ` + ` @@ -805,7 +805,7 @@ expect(sizzle('div.chat-info:last', chat_content).pop().textContent).toBe("fabio has entered the groupchat"); presence = u.toStanza( - ` + ` @@ -815,7 +815,7 @@ expect(sizzle('div.chat-info:last', chat_content).pop().textContent).toBe("Dele Olajide has entered the groupchat"); presence = u.toStanza( - ` + ` @@ -826,7 +826,7 @@ expect(sizzle('div.chat-info:last', chat_content).pop().textContent).toBe("jcbrand has entered the groupchat"); presence = u.toStanza( - ` + ` @@ -836,7 +836,7 @@ expect(sizzle('div.chat-info:last', chat_content).pop().textContent).toBe("Dele Olajide has entered and left the groupchat"); presence = u.toStanza( - ` + ` @@ -846,7 +846,7 @@ expect(sizzle('div.chat-info:last', chat_content).pop().textContent).toBe("Dele Olajide has entered the groupchat"); presence = u.toStanza( - ` + ` @@ -858,7 +858,7 @@ expect(sizzle('div.chat-info:last', chat_content).pop().textContent).toBe("fuvuv has entered the groupchat"); presence = u.toStanza( - ` + ` @@ -868,7 +868,7 @@ expect(sizzle('div.chat-info:last', chat_content).pop().textContent).toBe("fuvuv has entered and left the groupchat"); presence = u.toStanza( - ` + ` Disconnected: Replaced by new connection @@ -880,7 +880,7 @@ `fabio has entered and left the groupchat. "Disconnected: Replaced by new connection"`); presence = u.toStanza( - ` + ` Ready for a new day @@ -897,7 +897,7 @@ chat_content.innerHTML = ''; presence = u.toStanza( - ` + ` Disconnected: closed @@ -909,7 +909,7 @@ `fabio has left the groupchat. "Disconnected: closed"`); presence = u.toStanza( - ` + ` @@ -920,7 +920,7 @@ `Dele Olajide has left the groupchat`); presence = u.toStanza( - ` + ` @@ -944,12 +944,12 @@ expect(sizzle('div.chat-info', chat_content).pop().textContent).toBe('some1 has entered the groupchat'); let presence = $pres({ - to: 'dummy@localhost/resource', + to: 'romeo@montague.lit/orchard', from: 'coven@chat.shakespeare.lit/newguy' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -957,7 +957,7 @@ expect(sizzle('div.chat-info', chat_content).pop().textContent).toBe('newguy has entered the groupchat'); presence = $pres({ - to: 'dummy@localhost/resource', + to: 'romeo@montague.lit/orchard', type: 'unavailable', from: 'coven@chat.shakespeare.lit/newguy' }) @@ -965,7 +965,7 @@ .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'none' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -973,7 +973,7 @@ expect(sizzle('div.chat-info', chat_content).pop().textContent).toBe('newguy has entered and left the groupchat'); presence = u.toStanza( - ` + ` Ready for a new day @@ -985,7 +985,7 @@ expect(sizzle('div.chat-info:last', chat_content).pop().textContent).toBe(`fabio has entered the groupchat`); presence = u.toStanza( - ` + ` @@ -996,7 +996,7 @@ await test_utils.sendMessage(view, 'hello world'); presence = u.toStanza( - ` + ` Gotta go! @@ -1015,25 +1015,25 @@ // See https://github.com/conversejs/converse.js/issues/1259 - await test_utils.openAndEnterChatRoom(_converse, 'conversations', 'conference.siacs.eu', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'conversations', 'conference.siacs.eu', 'romeo'); const presence = $pres({ - to: 'dummy@localhost/resource', + to: 'romeo@montague.lit/orchard', from: 'conversations@conference.siacs.eu/Guus' }).c('x', { 'xmlns': Strophe.NS.MUC_USER }).c('item', { 'affiliation': 'none', - 'jid': 'Guus@localhost/xxx', + 'jid': 'Guus@montague.lit/xxx', 'role': 'visitor' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); const view = _converse.chatboxviews.get('conversations@conference.siacs.eu'); const msg = $msg({ - 'from': 'conversations@conference.siacs.eu/dummy', + 'from': 'conversations@conference.siacs.eu/romeo', 'id': (new Date()).getTime(), - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'type': 'groupchat' }).c('body').t('Some message').tree(); @@ -1041,7 +1041,7 @@ await new Promise((resolve, reject) => view.once('messageInserted', resolve)); let stanza = u.toStanza( - ` + ` @@ -1049,7 +1049,7 @@ _converse.connection._dataRecv(test_utils.createRequest(stanza)); stanza = u.toStanza( - ` + ` bf987c486c51fbc05a6a4a9f20dd19b5efba3758 @@ -1063,7 +1063,7 @@ const chat_content = view.el.querySelector('.chat-content'); const messages = chat_content.querySelectorAll('div.chat-info'); expect(messages.length).toBe(3); - expect(messages[0].textContent).toBe('dummy has entered the groupchat'); + expect(messages[0].textContent).toBe('romeo has entered the groupchat'); expect(messages[1].textContent).toBe('Guus has entered the groupchat'); expect(messages[2].textContent).toBe('Guus has left and re-entered the groupchat'); done(); @@ -1075,7 +1075,7 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'coven', 'chat.shakespeare.lit', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'coven', 'chat.shakespeare.lit', 'romeo'); const view = _converse.chatboxviews.get('coven@chat.shakespeare.lit'); const chat_content = view.el.querySelector('.chat-content'); let indicator = chat_content.querySelector('.date-separator'); @@ -1084,7 +1084,7 @@ expect(indicator.getAttribute('data-isodate')).toEqual(dayjs().startOf('day').toISOString()); expect(indicator.querySelector('time').textContent).toEqual(dayjs().startOf('day').format("dddd MMM Do YYYY")); expect(chat_content.querySelectorAll('div.chat-info').length).toBe(1); - expect(chat_content.querySelector('div.chat-info').textContent).toBe("dummy has entered the groupchat"); + expect(chat_content.querySelector('div.chat-info').textContent).toBe("romeo has entered the groupchat"); const baseTime = new Date(); jasmine.clock().install(); @@ -1092,21 +1092,21 @@ var ONE_DAY_LATER = 86400000; jasmine.clock().tick(ONE_DAY_LATER); - /* * - * + * * * * */ var presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/some1' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'owner', - 'jid': 'some1@localhost/_converse.js-290929789', + 'jid': 'some1@montague.lit/_converse.js-290929789', 'role': 'moderator' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -1127,7 +1127,7 @@ // Test a user leaving a groupchat presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', type: 'unavailable', from: 'coven@chat.shakespeare.lit/some1' }) @@ -1135,7 +1135,7 @@ .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'owner', - 'jid': 'some1@localhost/_converse.js-290929789', + 'jid': 'some1@montague.lit/_converse.js-290929789', 'role': 'moderator' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -1156,22 +1156,22 @@ let stanza = u.toStanza(` hello world - + `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/newguy' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -1191,11 +1191,11 @@ stanza = u.toStanza(` "+ hello world"+ - "+ + "+ `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); @@ -1203,7 +1203,7 @@ jasmine.clock().tick(ONE_DAY_LATER); // Test a user leaving a groupchat presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', type: 'unavailable', from: 'coven@chat.shakespeare.lit/newguy' }) @@ -1211,7 +1211,7 @@ .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'none' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -1237,20 +1237,20 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.waitUntilDiscoConfirmed(_converse, 'localhost', [], ['vcard-temp']); + await test_utils.waitUntilDiscoConfirmed(_converse, 'montague.lit', [], ['vcard-temp']); await test_utils.waitUntil(() => _converse.xmppstatus.vcard.get('fullname')); test_utils.createContacts(_converse, 'current'); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); if (!view.el.querySelectorAll('.chat-area').length) { view.renderChatArea(); } let message = '/me is tired'; const nick = mock.chatroom_names[0]; let msg = $msg({ - 'from': 'lounge@localhost/'+nick, + 'from': 'lounge@montague.lit/'+nick, 'id': (new Date()).getTime(), - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'type': 'groupchat' }).c('body').t(message).tree(); await view.model.onMessage(msg); @@ -1260,14 +1260,14 @@ message = '/me is as well'; msg = $msg({ - from: 'lounge@localhost/Max Mustermann', + from: 'lounge@montague.lit/Romeo Montague', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t(message).tree(); await view.model.onMessage(msg); await new Promise((resolve, reject) => view.once('messageInserted', resolve)); - expect(_.includes(sizzle('.chat-msg__author:last', view.el).pop().textContent, '**Max Mustermann')).toBeTruthy(); + expect(_.includes(sizzle('.chat-msg__author:last', view.el).pop().textContent, '**Romeo Montague')).toBeTruthy(); expect(sizzle('.chat-msg__text:last', view.el).pop().textContent).toBe('is as well'); done(); })); @@ -1292,27 +1292,27 @@ const features_stanza = $iq({ from: 'coven@chat.shakespeare.lit', 'id': IQ_id, - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'error' }).c('error', {'type': 'cancel'}) .c('item-not-found', {'xmlns': "urn:ietf:params:xml:ns:xmpp-stanzas"}); _converse.connection._dataRecv(test_utils.createRequest(features_stanza)); - /* * - * + * * * * */ const presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/some1' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'owner', - 'jid': 'dummy@localhost/_converse.js-29092160', + 'jid': 'romeo@montague.lit/_converse.js-29092160', 'role': 'moderator' }).up() .c('status', {code: '110'}); @@ -1344,7 +1344,7 @@ */ const config_stanza = $iq({from: 'coven@chat.shakespeare.lit', 'id': IQ_id, - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'result'}) .c('query', { 'xmlns': 'http://jabber.org/protocol/muc#owner'}) .c('x', { 'xmlns': 'jabber:x:data', 'type': 'form'}) @@ -1496,9 +1496,9 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); var name; - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); const occupants = view.el.querySelector('.occupant-list'); var presence, role, jid, model; for (var i=0; i * @@ -1613,17 +1613,17 @@ * " */ const presence = $pres({ - to:'dummy@localhost/pda', - from:"lounge@localhost/<img src="x" onerror="alert(123)"/>" + to:'romeo@montague.lit/pda', + from:"lounge@montague.lit/<img src="x" onerror="alert(123)"/>" }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc#user'}) .c('item').attrs({ - jid: 'someone@localhost', + jid: 'someone@montague.lit', role: 'moderator', }).up() .c('status').attrs({code:'110'}).nodeTree; _converse.connection._dataRecv(test_utils.createRequest(presence)); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); const occupants = view.el.querySelector('.occupant-list').querySelectorAll('li .occupant-nick'); expect(occupants.length).toBe(2); expect(occupants[0].textContent.trim()).toBe("<img src="x" onerror="alert(123)"/>"); @@ -1635,20 +1635,20 @@ null, ['rosterGroupsFetched'], {'view_mode': 'fullscreen'}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); - let contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); + let contact_jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; let occupants = view.el.querySelector('.occupant-list').querySelectorAll('li'); expect(occupants.length).toBe(1); - expect(occupants[0].querySelector('.occupant-nick').textContent.trim()).toBe("dummy"); + expect(occupants[0].querySelector('.occupant-nick').textContent.trim()).toBe("romeo"); expect(occupants[0].querySelectorAll('.badge').length).toBe(2); expect(occupants[0].querySelectorAll('.badge')[0].textContent).toBe('Owner'); expect(sizzle('.badge:last', occupants[0]).pop().textContent).toBe('Moderator'); var presence = $pres({ - to:'dummy@localhost/pda', - from:'lounge@localhost/moderatorman' + to:'romeo@montague.lit/pda', + from:'lounge@montague.lit/moderatorman' }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc#user'}) .c('item').attrs({ affiliation: 'admin', @@ -1660,20 +1660,20 @@ _converse.connection._dataRecv(test_utils.createRequest(presence)); occupants = view.el.querySelectorAll('.occupant-list li'); expect(occupants.length).toBe(2); - expect(occupants[0].querySelector('.occupant-nick').textContent.trim()).toBe("dummy"); - expect(occupants[1].querySelector('.occupant-nick').textContent.trim()).toBe("moderatorman"); - expect(occupants[1].querySelectorAll('.badge').length).toBe(2); - expect(occupants[1].querySelectorAll('.badge')[0].textContent).toBe('Admin'); - expect(occupants[1].querySelectorAll('.badge')[1].textContent).toBe('Moderator'); + expect(occupants[0].querySelector('.occupant-nick').textContent.trim()).toBe("moderatorman"); + expect(occupants[1].querySelector('.occupant-nick').textContent.trim()).toBe("romeo"); + expect(occupants[0].querySelectorAll('.badge').length).toBe(2); + expect(occupants[0].querySelectorAll('.badge')[0].textContent).toBe('Admin'); + expect(occupants[0].querySelectorAll('.badge')[1].textContent).toBe('Moderator'); - expect(occupants[1].getAttribute('title')).toBe( + expect(occupants[0].getAttribute('title')).toBe( contact_jid + ' This user is a moderator. Click to mention moderatorman in your message.' ); - contact_jid = mock.cur_names[3].replace(/ /g,'.').toLowerCase() + '@localhost'; + contact_jid = mock.cur_names[3].replace(/ /g,'.').toLowerCase() + '@montague.lit'; presence = $pres({ - to:'dummy@localhost/pda', - from:'lounge@localhost/visitorwoman' + to:'romeo@montague.lit/pda', + from:'lounge@montague.lit/visitorwoman' }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc#user'}) .c('item').attrs({ jid: contact_jid, @@ -1698,11 +1698,11 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openChatRoomViaModal(_converse, 'problematic@muc.localhost', 'dummy') + await test_utils.openChatRoomViaModal(_converse, 'problematic@muc.montague.lit', 'romeo') const presence = $pres().attrs({ - from:'problematic@muc.localhost', + from:'problematic@muc.montague.lit', id:'n13mt3l', - to:'dummy@localhost/pda', + to:'romeo@montague.lit/pda', type:'error'}) .c('error').attrs({'type':'cancel'}) .c('gone').attrs({'xmlns':'urn:ietf:params:xml:ns:xmpp-stanzas'}) @@ -1710,7 +1710,7 @@ .c('text').attrs({'xmlns':'urn:ietf:params:xml:ns:xmpp-stanzas'}) .t("We didn't like the name").nodeTree; - const view = _converse.chatboxviews.get('problematic@muc.localhost'); + const view = _converse.chatboxviews.get('problematic@muc.montague.lit'); spyOn(view, 'showErrorMessage').and.callThrough(); _converse.connection._dataRecv(test_utils.createRequest(presence)); expect(view.el.querySelector('.chatroom-body .disconnect-msg').textContent) @@ -1731,9 +1731,9 @@ const IQ_stanzas = _converse.connection.IQ_stanzas; const sendIQ = _converse.connection.sendIQ; - const room_jid = 'lounge@localhost'; + const room_jid = 'lounge@montague.lit'; - await test_utils.openChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); let stanza = await test_utils.waitUntil(() => _.filter( IQ_stanzas, @@ -1743,15 +1743,15 @@ ); // We pretend this is a new room, so no disco info is returned. const features_stanza = $iq({ - from: 'lounge@localhost', + from: 'lounge@montague.lit', 'id': stanza.getAttribute('id'), - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'error' }).c('error', {'type': 'cancel'}) .c('item-not-found', {'xmlns': "urn:ietf:params:xml:ns:xmpp-stanzas"}); _converse.connection._dataRecv(test_utils.createRequest(features_stanza)); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view.model, 'join').and.callThrough(); /* `+ ``); @@ -1801,13 +1801,13 @@ // See example 24: // https://xmpp.org/extensions/xep-0045.html#enter-pres const presence = $pres({ - to:'dummy@localhost/resource', - from:'lounge@localhost/thirdwitch', + to:'romeo@montague.lit/orchard', + from:'lounge@montague.lit/thirdwitch', id:'DC352437-C019-40EC-B590-AF29E879AF97' }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc#user'}) .c('item').attrs({ affiliation: 'member', - jid: 'dummy@localhost/resource', + jid: 'romeo@montague.lit/orchard', role: 'participant' }).up() .c('status').attrs({code:'110'}).up() @@ -1839,10 +1839,10 @@ 'muc_unmoderated', 'muc_anonymous' ] - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy', features); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo', features); spyOn(_converse.api, "trigger").and.callThrough(); spyOn(window, 'prompt').and.callFake(() => "Please join!"); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); const chat_area = view.el.querySelector('.chat-area'); expect(view.model.get('affiliation')).toBe('owner'); @@ -1857,15 +1857,15 @@ await test_utils.waitUntil(() => view.el.querySelectorAll('input.invited-contact').length); const input = view.el.querySelector('input.invited-contact'); expect(input.getAttribute('placeholder')).toBe('Invite'); - input.value = "Felix"; + input.value = "Balt"; let evt = new Event('input'); input.dispatchEvent(evt); let sent_stanza; spyOn(_converse.connection, 'send').and.callFake(stanza => (sent_stanza = stanza)); const hint = await test_utils.waitUntil(() => view.el.querySelector('.suggestion-box__results li')); - expect(input.value).toBe('Felix'); - expect(hint.textContent).toBe('Felix Amsel'); + expect(input.value).toBe('Balt'); + expect(hint.textContent).toBe('Balthasar'); evt = new Event('mousedown', {'bubbles': true}); evt.button = 0; @@ -1873,11 +1873,11 @@ expect(window.prompt).toHaveBeenCalled(); expect(view.model.directInvite).toHaveBeenCalled(); expect(sent_stanza.toLocaleString()).toBe( - ``+ - ``+ + ``+ `` ); done(); @@ -1890,13 +1890,13 @@ test_utils.createContacts(_converse, 'current'); // We need roster contacts, who can invite us spyOn(window, 'confirm').and.callFake(() => true); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); view.close(); // Hack, otherwise we have to mock stanzas. const name = mock.cur_names[0]; - const from_jid = name.replace(/ /g,'.').toLowerCase() + '@localhost'; - const room_jid = 'lounge@localhost'; + const from_jid = name.replace(/ /g,'.').toLowerCase() + '@montague.lit'; + const room_jid = 'lounge@montague.lit'; const reason = "Please join this groupchat"; expect(_converse.chatboxes.models.length).toBe(1); @@ -1922,9 +1922,9 @@ async function (done, _converse) { const text = 'This is a received message'; - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); spyOn(_converse.api, "trigger"); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); if (!view.el.querySelectorAll('.chat-area').length) { view.renderChatArea(); } @@ -1935,9 +1935,9 @@ }); const message = $msg({ - from: 'lounge@localhost/'+nick, + from: 'lounge@montague.lit/'+nick, id: '1', - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t(text); await view.model.onMessage(message.nodeTree); @@ -1954,9 +1954,9 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); spyOn(_converse.api, "trigger"); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); if (!view.el.querySelectorAll('.chat-area').length) { view.renderChatArea(); } @@ -1978,13 +1978,13 @@ // not shown. const stanza = u.toStanza(` ${text} + by="lounge@montague.lit"/> `); await view.model.onMessage(stanza); @@ -2002,16 +2002,16 @@ async function (done, _converse) { var message = 'This message is received while the chat area is scrolled up'; - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - var view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + var view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view, 'scrollDown').and.callThrough(); // Create enough messages so that there's a scrollbar. const promises = []; for (var i=0; i<20; i++) { view.model.onMessage( $msg({ - from: 'lounge@localhost/someone', - to: 'dummy@localhost.com', + from: 'lounge@montague.lit/someone', + to: 'romeo@montague.lit.com', type: 'groupchat', id: (new Date()).getTime(), }).c('body').t('Message: '+i).tree()); @@ -2023,8 +2023,8 @@ view.content.scrollTop = 0; await view.model.onMessage( $msg({ - from: 'lounge@localhost/someone', - to: 'dummy@localhost.com', + from: 'lounge@montague.lit/someone', + to: 'romeo@montague.lit.com', type: 'groupchat', id: (new Date()).getTime(), }).c('body').t(message).tree()); @@ -2110,7 +2110,7 @@ * See: https://xmpp.org/extensions/xep-0045.html#changenick * * @@ -2125,7 +2125,7 @@ * * * * @@ -2137,8 +2137,8 @@ * */ const __ = _converse.__; - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'oldnick'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'oldnick'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); expect(view.model.get('connection_status')).toBe(converse.ROOMSTATUS.ENTERED); const chat_content = view.el.querySelector('.chat-content'); @@ -2151,15 +2151,15 @@ .toBe("oldnick has entered the groupchat"); let presence = $pres().attrs({ - from:'lounge@localhost/oldnick', + from:'lounge@montague.lit/oldnick', id:'DC352437-C019-40EC-B590-AF29E879AF98', - to:'dummy@localhost/pda', + to:'romeo@montague.lit/pda', type:'unavailable' }) .c('x').attrs({xmlns:'http://jabber.org/protocol/muc#user'}) .c('item').attrs({ affiliation: 'owner', - jid: 'dummy@localhost/pda', + jid: 'romeo@montague.lit/pda', nick: 'newnick', role: 'moderator' }).up() @@ -2177,14 +2177,14 @@ expect(occupants.childNodes.length).toBe(1); presence = $pres().attrs({ - from:'lounge@localhost/newnick', + from:'lounge@montague.lit/newnick', id:'5B4F27A4-25ED-43F7-A699-382C6B4AFC67', - to:'dummy@localhost/pda' + to:'romeo@montague.lit/pda' }) .c('x').attrs({xmlns:'http://jabber.org/protocol/muc#user'}) .c('item').attrs({ affiliation: 'owner', - jid: 'dummy@localhost/pda', + jid: 'romeo@montague.lit/pda', role: 'moderator' }).up() .c('status').attrs({code:'110'}).nodeTree; @@ -2222,7 +2222,7 @@ // Check that the groupchat queried for the feautures. expect(Strophe.serialize(stanza)).toBe( - ``+ + ``+ ``+ ``); @@ -2248,7 +2248,7 @@ const features_stanza = $iq({ 'from': room_jid, 'id': stanza.getAttribute('id'), - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'result' }) .c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'}) @@ -2293,7 +2293,7 @@ 'muc_unmoderated', 'muc_nonanonymous' ]; - await test_utils.openAndEnterChatRoom(_converse, 'room', 'conference.example.org', 'dummy', features); + await test_utils.openAndEnterChatRoom(_converse, 'room', 'conference.example.org', 'romeo', features); const jid = 'room@conference.example.org'; const chatroomview = _converse.chatboxviews.get(jid); let features_list = chatroomview.el.querySelector('.features-list'); @@ -2326,7 +2326,7 @@ const response_el = u.toStanza( ` @@ -2399,8 +2399,8 @@ const result = $iq({ "xmlns": "jabber:client", "type": "result", - "to": "dummy@localhost/resource", - "from": "lounge@muc.localhost", + "to": "romeo@montague.lit/orchard", + "from": "lounge@muc.montague.lit", "id": iq.getAttribute('id') }); @@ -2416,7 +2416,7 @@ const features_stanza = $iq({ 'from': jid, 'id': iq.getAttribute('id'), - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'result' }).c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'}) .c('identity', { @@ -2484,7 +2484,7 @@ const features_stanza = $iq({ from: 'coven@chat.shakespeare.lit', 'id': IQ_id, - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'error' }).c('error', {'type': 'cancel'}) .c('item-not-found', {'xmlns': "urn:ietf:params:xml:ns:xmpp-stanzas"}); @@ -2493,7 +2493,7 @@ const view = _converse.chatboxviews.get('coven@chat.shakespeare.lit'); /* * * @@ -2503,7 +2503,7 @@ */ const message = $msg({ type:'groupchat', - to: 'dummy@localhost/_converse.js-27854181', + to: 'romeo@montague.lit/_converse.js-27854181', from: 'coven@chat.shakespeare.lit' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('status', {code: '104'}).up() @@ -2534,16 +2534,16 @@ * * */ - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); var presence = $pres().attrs({ - from:'lounge@localhost/dummy', - to:'dummy@localhost/pda', + from:'lounge@montague.lit/romeo', + to:'romeo@montague.lit/pda', type:'unavailable' }) .c('x').attrs({xmlns:'http://jabber.org/protocol/muc#user'}) .c('item').attrs({ affiliation: 'none', - jid: 'dummy@localhost/pda', + jid: 'romeo@montague.lit/pda', role: 'none' }) .c('actor').attrs({nick: 'Fluellen'}).up() @@ -2553,7 +2553,7 @@ .c('status').attrs({code:'307'}).nodeTree; _converse.connection._dataRecv(test_utils.createRequest(presence)); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); expect(u.isVisible(view.el.querySelector('.chat-area'))).toBeFalsy(); expect(u.isVisible(view.el.querySelector('.occupants'))).toBeFalsy(); const chat_body = view.el.querySelector('.chatroom-body'); @@ -2573,7 +2573,7 @@ null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, async function (done, _converse) { - await test_utils.openChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); // We instantiate a new ChatBoxes collection, which by default // will be empty. test_utils.openControlBox(); @@ -2605,8 +2605,8 @@ null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, async function (done, _converse) { - await test_utils.openChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'), + await test_utils.openChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'), trimmed_chatboxes = _converse.minimized_chats; spyOn(view, 'minimize').and.callThrough(); @@ -2636,8 +2636,8 @@ null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, async function (done, _converse) { - await test_utils.openChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view, 'close').and.callThrough(); spyOn(_converse.api, "trigger"); spyOn(view.model, 'leave'); @@ -2659,8 +2659,8 @@ async function (done, _converse) { spyOn(window, 'confirm').and.callFake(() => true); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); const textarea = view.el.querySelector('.chat-textarea'); textarea.value = '/clear'; @@ -2732,8 +2732,8 @@ null, ['rosterGroupsFetched'], {muc_disable_slash_commands: ['mute', 'voice']}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); var textarea = view.el.querySelector('.chat-textarea'); const enter = { 'target': textarea, 'preventDefault': _.noop, 'keyCode': 13 }; spyOn(window, 'confirm').and.callFake(() => true); @@ -2771,19 +2771,19 @@ let iq_stanza; - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'muc.localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@muc.localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'muc.montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@muc.montague.lit'); /* We don't show join/leave messages for existing occupants. We * know about them because we receive their presences before we * receive our own. */ const presence = $pres({ - to: 'dummy@localhost/resource', - from: 'lounge@muc.localhost/marc' + to: 'romeo@montague.lit/orchard', + from: 'lounge@muc.montague.lit/marc' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'marc@localhost/_converse.js-290929789', + 'jid': 'marc@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -2817,9 +2817,9 @@ }); expect(_converse.connection.send).toHaveBeenCalled(); expect(Strophe.serialize(sent_stanza)).toBe( - ``+ + ``+ ``+ - ``+ + ``+ `Welcome to the club!`+ ``+ ``+ @@ -2828,19 +2828,19 @@ let result = $iq({ "xmlns": "jabber:client", "type": "result", - "to": "dummy@localhost/resource", - "from": "lounge@muc.localhost", + "to": "romeo@montague.lit/orchard", + "from": "lounge@muc.montague.lit", "id": sent_stanza.getAttribute('id') }); _converse.connection.IQ_stanzas = []; _converse.connection._dataRecv(test_utils.createRequest(result)); iq_stanza = await test_utils.waitUntil(() => _.filter( _converse.connection.IQ_stanzas, - iq => iq.querySelector('iq[to="lounge@muc.localhost"][type="get"] item[affiliation="member"]')).pop() + iq => iq.querySelector('iq[to="lounge@muc.montague.lit"][type="get"] item[affiliation="member"]')).pop() ); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -2850,8 +2850,8 @@ result = $iq({ "xmlns": "jabber:client", "type": "result", - "to": "dummy@localhost/resource", - "from": "lounge@muc.localhost", + "to": "romeo@montague.lit/orchard", + "from": "lounge@muc.montague.lit", "id": iq_stanza.getAttribute("id") }).c("query", {"xmlns": "http://jabber.org/protocol/muc#admin"}) .c("item", {"jid": "marc", "affiliation": "member"}); @@ -2860,11 +2860,11 @@ expect(view.model.occupants.length).toBe(2); iq_stanza = await test_utils.waitUntil(() => _.filter( _converse.connection.IQ_stanzas, - iq => iq.querySelector('iq[to="lounge@muc.localhost"][type="get"] item[affiliation="owner"]')).pop() + iq => iq.querySelector('iq[to="lounge@muc.montague.lit"][type="get"] item[affiliation="owner"]')).pop() ); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -2874,21 +2874,21 @@ result = $iq({ "xmlns": "jabber:client", "type": "result", - "to": "dummy@localhost/resource", - "from": "lounge@muc.localhost", + "to": "romeo@montague.lit/orchard", + "from": "lounge@muc.montague.lit", "id": iq_stanza.getAttribute("id") }).c("query", {"xmlns": "http://jabber.org/protocol/muc#admin"}) - .c("item", {"jid": "dummy@localhost", "affiliation": "owner"}); + .c("item", {"jid": "romeo@montague.lit", "affiliation": "owner"}); _converse.connection._dataRecv(test_utils.createRequest(result)); expect(view.model.occupants.length).toBe(2); iq_stanza = await test_utils.waitUntil(() => _.filter( _converse.connection.IQ_stanzas, - iq => iq.querySelector('iq[to="lounge@muc.localhost"][type="get"] item[affiliation="admin"]')).pop() + iq => iq.querySelector('iq[to="lounge@muc.montague.lit"][type="get"] item[affiliation="admin"]')).pop() ); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -2898,8 +2898,8 @@ result = $iq({ "xmlns": "jabber:client", "type": "result", - "to": "dummy@localhost/resource", - "from": "lounge@muc.localhost", + "to": "romeo@montague.lit/orchard", + "from": "lounge@muc.montague.lit", "id": iq_stanza.getAttribute("id") }).c("query", {"xmlns": "http://jabber.org/protocol/muc#admin"}) _converse.connection._dataRecv(test_utils.createRequest(result)); @@ -2915,8 +2915,8 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view, 'clearMessages'); let sent_stanza; spyOn(_converse.connection, 'send').and.callFake(function (stanza) { @@ -2943,7 +2943,7 @@ expect(sent_stanza.textContent).toBe('This is a new subject'); expect(Strophe.serialize(sent_stanza).toLocaleString()).toBe( - ''+ + ''+ 'This is a new subject'+ ''); @@ -2956,7 +2956,7 @@ }); expect(sent_stanza.textContent).toBe('This is yet another subject'); expect(Strophe.serialize(sent_stanza).toLocaleString()).toBe( - ''+ + ''+ 'This is yet another subject'+ ''); done(); @@ -2967,8 +2967,8 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view, 'clearMessages'); const textarea = view.el.querySelector('.chat-textarea') textarea.value = '/clear'; @@ -2993,20 +2993,20 @@ IQ_id = sendIQ.bind(this)(iq, callback, errback); }); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view.model, 'setAffiliation').and.callThrough(); spyOn(view, 'showErrorMessage').and.callThrough(); spyOn(view, 'validateRoleOrAffiliationChangeArgs').and.callThrough(); let presence = $pres({ - 'from': 'lounge@localhost/annoyingGuy', + 'from': 'lounge@montague.lit/annoyingGuy', 'id':'27C55F89-1C6A-459A-9EB5-77690145D624', - 'to': 'dummy@localhost/desktop' + 'to': 'romeo@montague.lit/desktop' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'annoyingguy@localhost', + 'jid': 'annoyingguy@montague.lit', 'affiliation': 'member', 'role': 'participant' }); @@ -3045,22 +3045,22 @@ expect(view.showErrorMessage.calls.count()).toBe(2); // Check that the member list now gets updated expect(sent_IQ.toLocaleString()).toBe( - ``+ + ``+ ``+ - ``+ + ``+ `You're responsible`+ ``+ ``+ ``); presence = $pres({ - 'from': 'lounge@localhost/annoyingGuy', + 'from': 'lounge@montague.lit/annoyingGuy', 'id':'27C55F89-1C6A-459A-9EB5-77690145D628', - 'to': 'dummy@localhost/desktop' + 'to': 'romeo@montague.lit/desktop' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'annoyingguy@localhost', + 'jid': 'annoyingguy@montague.lit', 'affiliation': 'owner', 'role': 'participant' }); @@ -3081,20 +3081,20 @@ IQ_id = sendIQ.bind(this)(iq, callback, errback); }); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view.model, 'setAffiliation').and.callThrough(); spyOn(view, 'showErrorMessage').and.callThrough(); spyOn(view, 'validateRoleOrAffiliationChangeArgs').and.callThrough(); let presence = $pres({ - 'from': 'lounge@localhost/annoyingGuy', + 'from': 'lounge@montague.lit/annoyingGuy', 'id':'27C55F89-1C6A-459A-9EB5-77690145D624', - 'to': 'dummy@localhost/desktop' + 'to': 'romeo@montague.lit/desktop' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'annoyingguy@localhost', + 'jid': 'annoyingguy@montague.lit', 'affiliation': 'member', 'role': 'participant' }); @@ -3123,22 +3123,22 @@ expect(view.model.setAffiliation).toHaveBeenCalled(); // Check that the member list now gets updated expect(sent_IQ.toLocaleString()).toBe( - ``+ + ``+ ``+ - ``+ + ``+ `You're annoying`+ ``+ ``+ ``); presence = $pres({ - 'from': 'lounge@localhost/annoyingGuy', + 'from': 'lounge@montague.lit/annoyingGuy', 'id':'27C55F89-1C6A-459A-9EB5-77690145D628', - 'to': 'dummy@localhost/desktop' + 'to': 'romeo@montague.lit/desktop' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'annoyingguy@localhost', + 'jid': 'annoyingguy@montague.lit', 'affiliation': 'outcast', 'role': 'participant' }); @@ -3161,20 +3161,20 @@ IQ_id = sendIQ.bind(this)(iq, callback, errback); }); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view.model, 'setRole').and.callThrough(); spyOn(view, 'showErrorMessage').and.callThrough(); spyOn(view, 'validateRoleOrAffiliationChangeArgs').and.callThrough(); let presence = $pres({ - 'from': 'lounge@localhost/annoying guy', + 'from': 'lounge@montague.lit/annoying guy', 'id':'27C55F89-1C6A-459A-9EB5-77690145D624', - 'to': 'dummy@localhost/desktop' + 'to': 'romeo@montague.lit/desktop' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'annoyingguy@localhost', + 'jid': 'annoyingguy@montague.lit', 'affiliation': 'none', 'role': 'participant' }); @@ -3202,7 +3202,7 @@ expect(view.showErrorMessage.calls.count()).toBe(1); expect(view.model.setRole).toHaveBeenCalled(); expect(sent_IQ.toLocaleString()).toBe( - ``+ + ``+ ``+ ``+ `You're annoying`+ @@ -3221,8 +3221,8 @@ * */ presence = $pres({ - 'from': 'lounge@localhost/annoying guy', - 'to': 'dummy@localhost/desktop', + 'from': 'lounge@montague.lit/annoying guy', + 'to': 'romeo@montague.lit/desktop', 'type': 'unavailable' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) @@ -3243,14 +3243,14 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); var sent_IQ, IQ_id; var sendIQ = _converse.connection.sendIQ; spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) { sent_IQ = iq; IQ_id = sendIQ.bind(this)(iq, callback, errback); }); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view.model, 'setRole').and.callThrough(); spyOn(view, 'showErrorMessage').and.callThrough(); spyOn(view, 'showChatEvent').and.callThrough(); @@ -3267,13 +3267,13 @@ * */ let presence = $pres({ - 'from': 'lounge@localhost/trustworthyguy', + 'from': 'lounge@montague.lit/trustworthyguy', 'id':'27C55F89-1C6A-459A-9EB5-77690145D624', - 'to': 'dummy@localhost/desktop' + 'to': 'romeo@montague.lit/desktop' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'trustworthyguy@localhost', + 'jid': 'trustworthyguy@montague.lit', 'affiliation': 'member', 'role': 'participant' }); @@ -3305,7 +3305,7 @@ expect(view.showErrorMessage.calls.count()).toBe(1); expect(view.model.setRole).toHaveBeenCalled(); expect(sent_IQ.toLocaleString()).toBe( - ``+ + ``+ ``+ ``+ `You're trustworthy`+ @@ -3324,12 +3324,12 @@ * */ presence = $pres({ - 'from': 'lounge@localhost/trustworthyguy', - 'to': 'dummy@localhost/desktop' + 'from': 'lounge@montague.lit/trustworthyguy', + 'to': 'romeo@montague.lit/desktop' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'trustworthyguy@localhost', + 'jid': 'trustworthyguy@montague.lit', 'affiliation': 'member', 'role': 'moderator' }); @@ -3347,7 +3347,7 @@ expect(view.showChatEvent.calls.count()).toBe(1); expect(view.model.setRole).toHaveBeenCalled(); expect(sent_IQ.toLocaleString()).toBe( - ``+ + ``+ ``+ ``+ `Perhaps not`+ @@ -3366,11 +3366,11 @@ * */ presence = $pres({ - 'from': 'lounge@localhost/trustworthyguy', - 'to': 'dummy@localhost/desktop' + 'from': 'lounge@montague.lit/trustworthyguy', + 'to': 'romeo@montague.lit/desktop' }).c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'trustworthyguy@localhost', + 'jid': 'trustworthyguy@montague.lit', 'affiliation': 'member', 'role': 'participant' }); @@ -3385,14 +3385,14 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); var sent_IQ, IQ_id; var sendIQ = _converse.connection.sendIQ; spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) { sent_IQ = iq; IQ_id = sendIQ.bind(this)(iq, callback, errback); }); - var view = _converse.chatboxviews.get('lounge@localhost'); + var view = _converse.chatboxviews.get('lounge@montague.lit'); spyOn(view.model, 'setRole').and.callThrough(); spyOn(view, 'showErrorMessage').and.callThrough(); spyOn(view, 'showChatEvent').and.callThrough(); @@ -3409,13 +3409,13 @@ * */ var presence = $pres({ - 'from': 'lounge@localhost/annoyingGuy', + 'from': 'lounge@montague.lit/annoyingGuy', 'id':'27C55F89-1C6A-459A-9EB5-77690145D624', - 'to': 'dummy@localhost/desktop' + 'to': 'romeo@montague.lit/desktop' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'annoyingguy@localhost', + 'jid': 'annoyingguy@montague.lit', 'affiliation': 'member', 'role': 'participant' }); @@ -3446,7 +3446,7 @@ expect(view.showErrorMessage.calls.count()).toBe(1); expect(view.model.setRole).toHaveBeenCalled(); expect(sent_IQ.toLocaleString()).toBe( - ``+ + ``+ ``+ ``+ `You're annoying`+ @@ -3465,12 +3465,12 @@ * */ presence = $pres({ - 'from': 'lounge@localhost/annoyingGuy', - 'to': 'dummy@localhost/desktop' + 'from': 'lounge@montague.lit/annoyingGuy', + 'to': 'romeo@montague.lit/desktop' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'annoyingguy@localhost', + 'jid': 'annoyingguy@montague.lit', 'affiliation': 'member', 'role': 'visitor' }); @@ -3489,7 +3489,7 @@ expect(view.showChatEvent.calls.count()).toBe(1); expect(view.model.setRole).toHaveBeenCalled(); expect(sent_IQ.toLocaleString()).toBe( - ``+ + ``+ ``+ ``+ `Now you can talk again`+ @@ -3508,12 +3508,12 @@ * */ presence = $pres({ - 'from': 'lounge@localhost/annoyingGuy', - 'to': 'dummy@localhost/desktop' + 'from': 'lounge@montague.lit/annoyingGuy', + 'to': 'romeo@montague.lit/desktop' }) .c('x', { 'xmlns': 'http://jabber.org/protocol/muc#user'}) .c('item', { - 'jid': 'annoyingguy@localhost', + 'jid': 'annoyingguy@montague.lit', 'affiliation': 'member', 'role': 'participant' }); @@ -3528,19 +3528,19 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); let sent_IQ, IQ_id; const sendIQ = _converse.connection.sendIQ; spyOn(_converse.connection, 'sendIQ').and.callFake(function (iq, callback, errback) { sent_IQ = iq; IQ_id = sendIQ.bind(this)(iq, callback, errback); }); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); const textarea = view.el.querySelector('.chat-textarea'); textarea.value = '/destroy bored'; view.onFormSubmitted(new Event('submit')); expect(sent_IQ.toLocaleString()).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -3550,9 +3550,9 @@ ``+ ``); - /* */ @@ -3579,8 +3579,8 @@ null, ['rosterGroupsFetched', 'chatBoxesFetched'], {'nickname': 'Benedict-Cucumberpatch'}, async function (done, _converse) { - await test_utils.openChatRoomViaModal(_converse, 'roomy@muc.localhost'); - const view = _converse.chatboxviews.get('roomy@muc.localhost'); + await test_utils.openChatRoomViaModal(_converse, 'roomy@muc.montague.lit'); + const view = _converse.chatboxviews.get('roomy@muc.montague.lit'); expect(view.model.get('nick')).toBe('Benedict-Cucumberpatch'); done(); })); @@ -3591,17 +3591,17 @@ async function (done, _converse) { const groupchat_jid = 'protected'; - await test_utils.openChatRoomViaModal(_converse, groupchat_jid, 'dummy'); + await test_utils.openChatRoomViaModal(_converse, groupchat_jid, 'romeo'); const view = _converse.chatboxviews.get(groupchat_jid); spyOn(view, 'renderPasswordForm').and.callThrough(); const presence = $pres().attrs({ - 'from': `${groupchat_jid}/dummy`, + 'from': `${groupchat_jid}/romeo`, 'id': u.getUniqueId(), - 'to': 'dummy@localhost/pda', + 'to': 'romeo@montague.lit/pda', 'type': 'error' }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc'}).up() - .c('error').attrs({by:'lounge@localhost', type:'auth'}) + .c('error').attrs({by:'lounge@montague.lit', type:'auth'}) .c('not-authorized').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -3617,7 +3617,7 @@ const input_el = view.el.querySelector('[name="password"]'); input_el.value = 'secret'; view.el.querySelector('input[type=submit]').click(); - expect(view.model.join).toHaveBeenCalledWith('dummy', 'secret'); + expect(view.model.join).toHaveBeenCalledWith('romeo', 'secret'); done(); })); @@ -3626,15 +3626,15 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - const groupchat_jid = 'members-only@muc.localhost' - await test_utils.openChatRoomViaModal(_converse, groupchat_jid, 'dummy'); + const groupchat_jid = 'members-only@muc.montague.lit' + await test_utils.openChatRoomViaModal(_converse, groupchat_jid, 'romeo'); const presence = $pres().attrs({ - from: `${groupchat_jid}/dummy`, + from: `${groupchat_jid}/romeo`, id: u.getUniqueId(), - to: 'dummy@localhost/pda', + to: 'romeo@montague.lit/pda', type: 'error' }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc'}).up() - .c('error').attrs({by:'lounge@localhost', type:'auth'}) + .c('error').attrs({by:'lounge@montague.lit', type:'auth'}) .c('registration-required').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; const view = _converse.chatboxviews.get(groupchat_jid); @@ -3650,15 +3650,15 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - const groupchat_jid = 'off-limits@muc.localhost' - await test_utils.openChatRoomViaModal(_converse, groupchat_jid, 'dummy'); + const groupchat_jid = 'off-limits@muc.montague.lit' + await test_utils.openChatRoomViaModal(_converse, groupchat_jid, 'romeo'); const presence = $pres().attrs({ - from: `${groupchat_jid}/dummy`, + from: `${groupchat_jid}/romeo`, id: u.getUniqueId(), - to: 'dummy@localhost/pda', + to: 'romeo@montague.lit/pda', type: 'error' }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc'}).up() - .c('error').attrs({by:'lounge@localhost', type:'auth'}) + .c('error').attrs({by:'lounge@montague.lit', type:'auth'}) .c('forbidden').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; const view = _converse.chatboxviews.get(groupchat_jid); @@ -3674,15 +3674,15 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - const groupchat_jid = 'conflicted@muc.localhost'; - await test_utils.openChatRoomViaModal(_converse, groupchat_jid, 'dummy'); + const groupchat_jid = 'conflicted@muc.montague.lit'; + await test_utils.openChatRoomViaModal(_converse, groupchat_jid, 'romeo'); var presence = $pres().attrs({ - from: `${groupchat_jid}/dummy`, + from: `${groupchat_jid}/romeo`, id: u.getUniqueId(), - to: 'dummy@localhost/pda', + to: 'romeo@montague.lit/pda', type: 'error' }).c('x').attrs({xmlns:'http://jabber.org/protocol/muc'}).up() - .c('error').attrs({by:'lounge@localhost', type:'cancel'}) + .c('error').attrs({by:'lounge@montague.lit', type:'cancel'}) .c('conflict').attrs({xmlns:'urn:ietf:params:xml:ns:xmpp-stanzas'}).nodeTree; const view = _converse.chatboxviews.get(groupchat_jid); @@ -3702,8 +3702,8 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - const groupchat_jid = 'conflicting@muc.localhost' - await test_utils.openChatRoomViaModal(_converse, groupchat_jid, 'dummy'); + const groupchat_jid = 'conflicting@muc.montague.lit' + await test_utils.openChatRoomViaModal(_converse, groupchat_jid, 'romeo'); /* _.filter( IQ_stanzas, iq => iq.querySelector( @@ -3878,7 +3878,7 @@ )).pop()); // Check that the groupchat queried for the feautures. expect(Strophe.serialize(stanza)).toBe( - ``+ + ``+ ``+ ``); @@ -3887,7 +3887,7 @@ const features_stanza = $iq({ from: 'coven@chat.shakespeare.lit', 'id': IQ_ids.pop(), - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'result' }) .c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'}) @@ -3914,7 +3914,7 @@ } }); var name = mock.cur_names[0]; - const invitee_jid = name.replace(/ /g,'.').toLowerCase() + '@localhost'; + const invitee_jid = name.replace(/ /g,'.').toLowerCase() + '@montague.lit'; var reason = "Please join this groupchat"; view.model.directInvite(invitee_jid, reason); @@ -3960,7 +3960,7 @@ var member_list_stanza = $iq({ 'from': 'coven@chat.shakespeare.lit', 'id': member_iq_id, - 'to': 'dummy@localhost/resource', + 'to': 'romeo@montague.lit/orchard', 'type': 'result' }).c('query', {'xmlns': Strophe.NS.MUC_ADMIN}) .c('item', { @@ -3974,7 +3974,7 @@ var admin_list_stanza = $iq({ 'from': 'coven@chat.shakespeare.lit', 'id': admin_iq_id, - 'to': 'dummy@localhost/resource', + 'to': 'romeo@montague.lit/orchard', 'type': 'result' }).c('query', {'xmlns': Strophe.NS.MUC_ADMIN}) .c('item', { @@ -3987,7 +3987,7 @@ var owner_list_stanza = $iq({ 'from': 'coven@chat.shakespeare.lit', 'id': owner_iq_id, - 'to': 'dummy@localhost/resource', + 'to': 'romeo@montague.lit/orchard', 'type': 'result' }).c('query', {'xmlns': Strophe.NS.MUC_ADMIN}) .c('item', { @@ -4011,7 +4011,7 @@ ``); // Finally check that the user gets invited. expect(sent_stanza.toLocaleString()).toBe( // Strophe adds the xmlns attr (although not in spec) - ``+ + ``+ ``+ `` ); @@ -4026,7 +4026,7 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { - await test_utils.openChatRoom(_converse, 'coven', 'chat.shakespeare.lit', 'dummy'); + await test_utils.openChatRoom(_converse, 'coven', 'chat.shakespeare.lit', 'romeo'); var roomview = _converse.chatboxviews.get('coven@chat.shakespeare.lit'); var exclude_existing = false; @@ -4109,12 +4109,12 @@ expect(label_nick.textContent).toBe('Nickname:'); const nick_input = modal.el.querySelector('input[name="nickname"]'); expect(nick_input.value).toBe(''); - nick_input.value = 'dummy'; + nick_input.value = 'romeo'; expect(modal.el.querySelector('.modal-title').textContent).toBe('Enter a new Groupchat'); spyOn(_converse.ChatRoom.prototype, 'getRoomFeatures').and.callFake(() => Promise.resolve()); roomspanel.delegateEvents(); // We need to rebind all events otherwise our spy won't be called - modal.el.querySelector('input[name="chatroom"]').value = 'lounce@muc.localhost'; + modal.el.querySelector('input[name="chatroom"]').value = 'lounce@muc.montague.lit'; modal.el.querySelector('form input[type="submit"]').click(); await test_utils.waitUntil(() => _converse.chatboxes.length); await test_utils.waitUntil(() => sizzle('.chatroom', _converse.el).filter(u.isVisible).length === 1); @@ -4141,13 +4141,13 @@ const modal = roomspanel.add_room_modal; await test_utils.waitUntil(() => u.isVisible(modal.el), 1000) const name_input = modal.el.querySelector('input[name="chatroom"]'); - name_input.value = 'lounge@localhost'; + name_input.value = 'lounge@montague.lit'; expect(modal.el.querySelector('label[for="nickname"]')).toBe(null); expect(modal.el.querySelector('input[name="nickname"]')).toBe(null); modal.el.querySelector('form input[type="submit"]').click(); await test_utils.waitUntil(() => _converse.chatboxes.length > 1); - const chatroom = _converse.chatboxes.get('lounge@localhost'); - expect(chatroom.get('nick')).toBe('dummy'); + const chatroom = _converse.chatboxes.get('lounge@montague.lit'); + expect(chatroom.get('nick')).toBe('romeo'); done(); })); @@ -4166,7 +4166,7 @@ const label_nick = modal.el.querySelector('label[for="nickname"]'); expect(label_nick.textContent).toBe('Nickname:'); const nick_input = modal.el.querySelector('input[name="nickname"]'); - expect(nick_input.value).toBe('dummy'); + expect(nick_input.value).toBe('romeo'); done(); })); @@ -4300,7 +4300,7 @@ ); const id = sent_stanza.getAttribute('id'); expect(Strophe.serialize(sent_stanza)).toBe( - ``+ @@ -4308,8 +4308,8 @@ `` ); const iq = $iq({ - 'from':'muc.localhost', - 'to':'dummy@localhost/pda', + 'from':'muc.montague.lit', + 'to':'romeo@montague.lit/pda', 'id': id, 'type':'result' }).c('query') @@ -4387,14 +4387,14 @@ s => sizzle(`query[xmlns="http://jabber.org/protocol/disco#items"]`, s).length).pop() ); expect(Strophe.serialize(sent_stanza)).toBe( - ``+ ``+ `` ); const iq = $iq({ - from:'muc.localhost', - to:'dummy@localhost/pda', + from:'muc.montague.lit', + to:'romeo@montague.lit/pda', id: sent_stanza.getAttribute('id'), type:'result' }).c('query') @@ -4433,13 +4433,13 @@ const view = _converse.chatboxviews.get(room_jid); view.model.set({'minimized': true}); - const contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const nick = mock.chatroom_names[0]; await view.model.onMessage($msg({ from: room_jid+'/'+nick, id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t(message).tree()); await test_utils.waitUntil(() => view.model.messages.length); @@ -4450,7 +4450,7 @@ await view.model.onMessage($msg({ 'from': room_jid+'/'+nick, 'id': (new Date()).getTime(), - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'type': 'groupchat' }).c('body').t(message).tree()); await test_utils.waitUntil(() => view.model.messages.length > 1); @@ -4482,13 +4482,13 @@ .toBe("some1 has entered the groupchat"); let presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/newguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -4497,13 +4497,13 @@ .toBe("newguy has entered the groupchat"); presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/nomorenicks' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'nomorenicks@localhost/_converse.js-290929789', + 'jid': 'nomorenicks@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -4517,7 +4517,7 @@ let msg = $msg({ from: room_jid+'/newguy', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree(); @@ -4542,7 +4542,7 @@ msg = $msg({ from: room_jid+'/newguy', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree(); await view.model.onMessage(msg); @@ -4562,7 +4562,7 @@ msg = $msg({ from: room_jid+'/nomorenicks', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree(); await view.model.onMessage(msg); @@ -4582,7 +4582,7 @@ msg = $msg({ from: `${room_jid}/some1`, id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t('hello world').tree(); await view.model.onMessage(msg); @@ -4629,21 +4629,21 @@ const view = _converse.chatboxviews.get('coven@chat.shakespeare.lit'); const chat_content = view.el.querySelector('.chat-content'); - /* * - * + * * * * */ let presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/some1' }).c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'owner', - 'jid': 'dummy@localhost/_converse.js-29092160', + 'jid': 'romeo@montague.lit/_converse.js-29092160', 'role': 'moderator' }).up() .c('status', {code: '110'}); @@ -4652,13 +4652,13 @@ .toBe("some1 has entered the groupchat"); presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/newguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -4667,13 +4667,13 @@ .toBe("newguy has entered the groupchat"); presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/nomorenicks' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'nomorenicks@localhost/_converse.js-290929789', + 'jid': 'nomorenicks@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -4687,7 +4687,7 @@ var msg = $msg({ from: room_jid+'/newguy', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree(); await view.model.onMessage(msg); @@ -4708,7 +4708,7 @@ msg = $msg({ from: room_jid+'/newguy', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree(); await view.model.onMessage(msg); @@ -4727,7 +4727,7 @@ msg = $msg({ from: room_jid+'/nomorenicks', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').c('composing', {'xmlns': Strophe.NS.CHATSTATES}).tree(); await view.model.onMessage(msg); @@ -4750,7 +4750,7 @@ msg = $msg({ from: room_jid+'/newguy', id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').c('paused', {'xmlns': Strophe.NS.CHATSTATES}).tree(); await view.model.onMessage(msg); @@ -4782,14 +4782,14 @@ null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'trollbox', 'localhost', 'troll'); - const view = _converse.chatboxviews.get('trollbox@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'trollbox', 'montague.lit', 'troll'); + const view = _converse.chatboxviews.get('trollbox@montague.lit'); const textarea = view.el.querySelector('.chat-textarea'); textarea.value = 'Hello world'; view.onFormSubmitted(new Event('submit')); const stanza = u.toStanza(` - + `); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -4811,14 +4811,14 @@ Strophe.NS.SID, 'muc_moderated', ] - await test_utils.openAndEnterChatRoom(_converse, 'trollbox', 'localhost', 'troll', features); - const view = _converse.chatboxviews.get('trollbox@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'trollbox', 'montague.lit', 'troll', features); + const view = _converse.chatboxviews.get('trollbox@montague.lit'); expect(_.isNull(view.el.querySelector('.chat-textarea'))).toBe(false); let stanza = u.toStanza(` + from='trollbox@montague.lit/troll' + to='romeo@montague.lit/orchard'> + from='trollbox@montague.lit/troll' + to='romeo@montague.lit/orchard'> { await test_utils.createContacts(_converse, 'current'); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.api.chatviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.api.chatviews.get('lounge@montague.lit'); if (!view.el.querySelectorAll('.chat-area').length) { view.renderChatArea(); } @@ -64,12 +64,12 @@ spyOn(_converse, 'showMessageNotification').and.callThrough(); spyOn(_converse, 'areDesktopNotificationsEnabled').and.returnValue(true); - const message = 'dummy: This message will show a desktop notification'; + const message = 'romeo: This message will show a desktop notification'; const nick = mock.chatroom_names[0], msg = $msg({ - from: 'lounge@localhost/'+nick, + from: 'lounge@montague.lit/'+nick, id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t(message).tree(); @@ -94,7 +94,7 @@ const stanza = $msg({ 'type': 'headline', 'from': 'notify.example.com', - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'xml:lang': 'en' }) .c('subject').t('SIEVE').up() @@ -120,7 +120,7 @@ const stanza = $msg({ 'type': 'headline', 'from': 'someone@notify.example.com', - 'to': 'dummy@localhost', + 'to': 'romeo@montague.lit', 'xml:lang': 'en' }) .c('subject').t('SIEVE').up() @@ -143,7 +143,7 @@ test_utils.createContacts(_converse, 'current'); spyOn(_converse, 'areDesktopNotificationsEnabled').and.returnValue(true); spyOn(_converse, 'showChatStateNotification'); - const jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@localhost'; + const jid = mock.cur_names[2].replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.roster.get(jid).presence.set('show', 'busy'); // This will emit 'contactStatusChanged' expect(_converse.areDesktopNotificationsEnabled).toHaveBeenCalled(); expect(_converse.showChatStateNotification).toHaveBeenCalled(); @@ -173,18 +173,18 @@ async (done, _converse) => { test_utils.createContacts(_converse, 'current'); - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); _converse.play_sounds = true; spyOn(_converse, 'playSoundNotification'); - const view = _converse.chatboxviews.get('lounge@localhost'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); if (!view.el.querySelectorAll('.chat-area').length) { view.renderChatArea(); } - let text = 'This message will play a sound because it mentions dummy'; + let text = 'This message will play a sound because it mentions romeo'; let message = $msg({ - from: 'lounge@localhost/otheruser', + from: 'lounge@montague.lit/otheruser', id: '1', - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t(text); await view.model.onMessage(message.nodeTree); @@ -193,20 +193,20 @@ text = "This message won't play a sound"; message = $msg({ - from: 'lounge@localhost/otheruser', + from: 'lounge@montague.lit/otheruser', id: '2', - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t(text); await view.model.onMessage(message.nodeTree); expect(_converse.playSoundNotification, 1); _converse.play_sounds = false; - text = "This message won't play a sound because it is sent by dummy"; + text = "This message won't play a sound because it is sent by romeo"; message = $msg({ - from: 'lounge@localhost/dummy', + from: 'lounge@montague.lit/romeo', id: '3', - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t(text); await view.model.onMessage(message.nodeTree); diff --git a/spec/omemo.js b/spec/omemo.js index 3e7c8776b..3daa9b002 100644 --- a/spec/omemo.js +++ b/spec/omemo.js @@ -83,7 +83,7 @@ const message = 'This message will be encrypted' test_utils.createContacts(_converse, 'current', 1); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const view = await test_utils.openChatBoxFor(_converse, contact_jid); const payload = await view.model.encryptMessage(message); const result = await view.model.decryptMessage(payload); @@ -100,7 +100,7 @@ let sent_stanza; test_utils.createContacts(_converse, 'current', 1); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => initializedOMEMO(_converse)); await test_utils.openChatBoxFor(_converse, contact_jid); let iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, contact_jid)); @@ -171,8 +171,8 @@ _converse.connection._dataRecv(test_utils.createRequest(stanza)); await test_utils.waitUntil(() => sent_stanza); expect(sent_stanza.toLocaleString()).toBe( - ``+ `This is an OMEMO encrypted message which your client doesn’t seem to support. Find more information on https://conversations.im/omemo`+ ``+ @@ -250,8 +250,8 @@ 'muc_unmoderated', 'muc_nonanonymous' ]; - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy', features); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo', features); + const view = _converse.chatboxviews.get('lounge@montague.lit'); await test_utils.waitUntil(() => initializedOMEMO(_converse)); const toolbar = view.el.querySelector('.chat-toolbar'); @@ -260,15 +260,15 @@ expect(view.model.get('omemo_active')).toBe(true); // newguy enters the room - const contact_jid = 'newguy@localhost'; + const contact_jid = 'newguy@montague.lit'; let stanza = $pres({ - 'to': 'dummy@localhost/resource', - 'from': 'lounge@localhost/newguy' + 'to': 'romeo@montague.lit/orchard', + 'from': 'lounge@montague.lit/newguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }).tree(); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -276,7 +276,7 @@ // Wait for Converse to fetch newguy's device list let iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, contact_jid)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -361,9 +361,9 @@ const sent_stanza = _converse.connection.send.calls.all()[0].args[0]; expect(Strophe.serialize(sent_stanza)).toBe( - ``+ `This is an OMEMO encrypted message which your client doesn’t seem to support. Find more information on https://conversations.im/omemo`+ @@ -391,7 +391,7 @@ let sent_stanza; test_utils.createContacts(_converse, 'current', 1); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => initializedOMEMO(_converse)); await test_utils.openChatBoxFor(_converse, contact_jid); let iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, contact_jid)); @@ -416,17 +416,17 @@ // Test reception of an encrypted carbon message const obj = await view.model.encryptMessage('This is an encrypted carbon message from another device of mine') const carbon = u.toStanza(` - + - - + + @@ -465,7 +465,7 @@ }); iq_stanza = await test_utils.waitUntil(() => bundleFetched(_converse, _converse.bare_jid, '988349631')); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -490,19 +490,19 @@ 'muc_unmoderated', 'muc_nonanonymous' ]; - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy', features); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo', features); + const view = _converse.chatboxviews.get('lounge@montague.lit'); await test_utils.waitUntil(() => initializedOMEMO(_converse)); - const contact_jid = 'newguy@localhost'; + const contact_jid = 'newguy@montague.lit'; let stanza = $pres({ - 'to': 'dummy@localhost/resource', - 'from': 'lounge@localhost/newguy' + 'to': 'romeo@montague.lit/orchard', + 'from': 'lounge@montague.lit/newguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }).tree(); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -522,7 +522,7 @@ }); let iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, contact_jid)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -594,7 +594,7 @@ const header = document.querySelector('.alert-danger .modal-title'); expect(header.textContent).toBe("Error"); expect(u.ancestor(header, '.modal-content').querySelector('.modal-body p').textContent.trim()) - .toBe("Sorry, we're unable to send an encrypted message because newguy@localhost requires you "+ + .toBe("Sorry, we're unable to send an encrypted message because newguy@montague.lit requires you "+ "to be subscribed to their presence in order to see their OMEMO information"); expect(view.model.get('omemo_supported')).toBe(false); @@ -611,7 +611,7 @@ let view, sent_stanza; test_utils.createContacts(_converse, 'current', 1); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.waitUntil(() => initializedOMEMO(_converse)); const obj = await _converse.ChatBox.prototype.encryptMessage('This is an encrypted message from the contact'); @@ -666,7 +666,7 @@ iq_stanza = await test_utils.waitUntil(() => bundleHasBeenPublished(_converse)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -715,12 +715,12 @@ ); test_utils.createContacts(_converse, 'current', 1); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; // Wait until own devices are fetched let iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, _converse.bare_jid)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -841,7 +841,7 @@ // Check that our own device is added again, but that removed // devices are not added. expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -889,10 +889,10 @@ ); test_utils.createContacts(_converse, 'current'); - const contact_jid = mock.cur_names[3].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[3].replace(/ /g,'.').toLowerCase() + '@montague.lit'; let iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, _converse.bare_jid)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -1042,7 +1042,7 @@ test_utils.createContacts(_converse, 'current', 1); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; let iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, _converse.bare_jid)); let stanza = $iq({ 'from': contact_jid, @@ -1067,7 +1067,7 @@ iq_stanza = await test_utils.waitUntil(() => bundleHasBeenPublished(_converse)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -1119,11 +1119,11 @@ test_utils.createContacts(_converse, 'current', 1); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; let iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, _converse.bare_jid)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -1149,7 +1149,7 @@ // Check that own device was published iq_stanza = await test_utils.waitUntil(() => ownDeviceHasBeenPublished(_converse)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -1200,7 +1200,7 @@ await test_utils.openChatBoxFor(_converse, contact_jid); iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, contact_jid)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -1293,8 +1293,8 @@ 'muc_unmoderated', 'muc_nonanonymous' ]; - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy', features); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo', features); + const view = _converse.chatboxviews.get('lounge@montague.lit'); await test_utils.waitUntil(() => initializedOMEMO(_converse)); const toolbar = view.el.querySelector('.chat-toolbar'); @@ -1314,22 +1314,22 @@ expect(u.hasClass('disabled', toggle)).toBe(false); expect(view.model.get('omemo_supported')).toBe(true); - let contact_jid = 'newguy@localhost'; + let contact_jid = 'newguy@montague.lit'; let stanza = $pres({ - to: 'dummy@localhost/resource', - from: 'lounge@localhost/newguy' + to: 'romeo@montague.lit/orchard', + from: 'lounge@montague.lit/newguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }).tree(); _converse.connection._dataRecv(test_utils.createRequest(stanza)); let iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, contact_jid)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -1401,10 +1401,10 @@ // Someone enters the room who doesn't have OMEMO support, while we // have OMEMO activated... - contact_jid = 'oldguy@localhost'; + contact_jid = 'oldguy@montague.lit'; stanza = $pres({ - to: 'dummy@localhost/resource', - from: 'lounge@localhost/oldguy' + to: 'romeo@montague.lit/orchard', + from: 'lounge@montague.lit/oldguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { @@ -1415,7 +1415,7 @@ _converse.connection._dataRecv(test_utils.createRequest(stanza)); iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, contact_jid)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ @@ -1466,7 +1466,7 @@ test_utils.createContacts(_converse, 'current', 1); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) // We simply emit, to avoid doing all the setup work _converse.api.trigger('OMEMOInitialized'); @@ -1478,7 +1478,7 @@ await test_utils.waitUntil(() => u.isVisible(modal.el), 1000); let iq_stanza = await test_utils.waitUntil(() => deviceListFetched(_converse, contact_jid)); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``); let stanza = $iq({ @@ -1495,7 +1495,7 @@ await test_utils.waitUntil(() => u.isVisible(modal.el), 1000); iq_stanza = await test_utils.waitUntil(() => bundleFetched(_converse, contact_jid, '555')); expect(Strophe.serialize(iq_stanza)).toBe( - ``+ + ``+ ``+ ``+ ``+ diff --git a/spec/ping.js b/spec/ping.js index e923707c8..2bcbb0537 100644 --- a/spec/ping.js +++ b/spec/ping.js @@ -44,7 +44,7 @@ }); _converse.ping(); expect(sent_stanza.toLocaleString()).toBe( - ``+ + ``+ ``+ ``); done(); diff --git a/spec/presence.js b/spec/presence.js index c3a48709e..9bcc99d39 100644 --- a/spec/presence.js +++ b/spec/presence.js @@ -120,11 +120,11 @@ test_utils.openControlBox(); test_utils.createContacts(_converse, 'current'); // Create some contacts so that we can test positioning - const contact_jid = mock.cur_names[8].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[8].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const contact = _converse.roster.get(contact_jid); let stanza = u.toStanza(` 1 '+ ' '+ ' 0'+ @@ -162,7 +162,7 @@ stanza = u.toStanza( ''+ ' 2'+ ' dnd'+ @@ -179,7 +179,7 @@ stanza = u.toStanza( ''+ ' 3'+ ' away'+ @@ -198,7 +198,7 @@ stanza = u.toStanza( ''+ ' 1'+ ' dnd'+ @@ -220,7 +220,7 @@ stanza = u.toStanza( ''+ ''); @@ -238,7 +238,7 @@ stanza = u.toStanza( ''+ ''); @@ -254,7 +254,7 @@ stanza = u.toStanza( ''+ ''); @@ -268,7 +268,7 @@ stanza = u.toStanza( ''+ ''); @@ -280,7 +280,7 @@ stanza = u.toStanza( ''+ ''); diff --git a/spec/protocol.js b/spec/protocol.js index 791e4bb31..5d08b8466 100644 --- a/spec/protocol.js +++ b/spec/protocol.js @@ -55,7 +55,7 @@ async function (done, _converse) { var contact, sent_stanza, IQ_id, stanza, modal; - await test_utils.waitUntilDiscoConfirmed(_converse, 'localhost', [], ['vcard-temp']); + await test_utils.waitUntilDiscoConfirmed(_converse, 'montague.lit', [], ['vcard-temp']); await test_utils.waitUntil(() => _converse.xmppstatus.vcard.get('fullname'), 300); /* The process by which a user subscribes to a contact, including * the interaction between roster items and subscription states. @@ -177,7 +177,7 @@ expect(contact.subscribe).toHaveBeenCalled(); expect(sent_stanza.toLocaleString()).toBe( // Strophe adds the xmlns attr (although not in spec) ``+ - `Max Mustermann`+ + `Romeo Montague`+ `` ); /* As a result, the user's server MUST initiate a second roster @@ -274,7 +274,7 @@ _converse.connection._dataRecv(test_utils.createRequest(stanza)); // Check that the IQ set was acknowledged. expect(Strophe.serialize(sent_stanza)).toBe( // Strophe adds the xmlns attr (although not in spec) - `` + `` ); expect(_converse.roster.updateContact).toHaveBeenCalled(); @@ -362,7 +362,7 @@ expect(u.hasClass('to', contacts[0])).toBe(false); expect(u.hasClass('both', contacts[0])).toBe(true); done(); - + })); it("Alternate Flow: Contact Declines Subscription Request", @@ -458,7 +458,7 @@ { roster_groups: false }, async function (done, _converse) { - var sent_IQ, IQ_id, jid = 'annegreet.gomez@localhost'; + var sent_IQ, IQ_id, jid = 'abram@montague.lit'; test_utils.openControlBox(_converse); test_utils.createContacts(_converse, 'current'); spyOn(window, 'confirm').and.returnValue(true); @@ -472,7 +472,7 @@ }); const header = sizzle('a:contains("My contacts")', _converse.rosterview.el).pop(); await test_utils.waitUntil(() => header.parentElement.querySelectorAll('li').length); - + // remove the first user header.parentElement.querySelector('li .remove-xmpp-contact').click(); expect(window.confirm).toHaveBeenCalled(); @@ -499,7 +499,7 @@ expect(sent_IQ.toLocaleString()).toBe( ``+ ``+ - ``+ + ``+ ``+ ``); diff --git a/spec/push.js b/spec/push.js index 88e8892dd..08f1f53a6 100644 --- a/spec/push.js +++ b/spec/push.js @@ -78,12 +78,12 @@ ``+ `` ); - const result = u.toStanza(``); + const result = u.toStanza(``); _converse.connection._dataRecv(test_utils.createRequest(result)); await test_utils.waitUntil(() => _converse.session.get('push_enabled')); expect(_converse.session.get('push_enabled').length).toBe(1); - expect(_.includes(_converse.session.get('push_enabled'), 'dummy@localhost')).toBe(true); + expect(_.includes(_converse.session.get('push_enabled'), 'romeo@montague.lit')).toBe(true); test_utils.openAndEnterChatRoom(_converse, 'coven', 'chat.shakespeare.lit', 'oldhag'); await test_utils.waitUntilDiscoConfirmed( diff --git a/spec/room_registration.js b/spec/room_registration.js index 925115fda..8bb045b54 100644 --- a/spec/room_registration.js +++ b/spec/room_registration.js @@ -36,7 +36,7 @@ ).pop()); }).then(stanza => { expect(Strophe.serialize(stanza)) - .toBe(``+ ``); view = _converse.chatboxviews.get(room_jid); @@ -59,7 +59,7 @@ ).pop()); }).then(stanza => { expect(Strophe.serialize(stanza)).toBe( - ``+ + ``+ ``+ ``+ `http://jabber.org/protocol/muc#register`+ @@ -94,7 +94,7 @@ const features_stanza = $iq({ 'from': room_jid, 'id': stanza.getAttribute('id'), - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'result' }).c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'}) .c('identity', { @@ -129,7 +129,7 @@ ).pop()); }).then(stanza => { expect(Strophe.serialize(stanza)) - .toBe(``+ ``); view = _converse.chatboxviews.get(room_jid); @@ -152,7 +152,7 @@ ).pop()); }).then(stanza => { expect(Strophe.serialize(stanza)).toBe( - ``+ + ``+ ``+ ``+ `http://jabber.org/protocol/muc#register`+ diff --git a/spec/roomslist.js b/spec/roomslist.js index aad636965..9e67c01d7 100644 --- a/spec/roomslist.js +++ b/spec/roomslist.js @@ -23,7 +23,7 @@ let room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room"); expect(room_els.length).toBe(1); expect(room_els[0].innerText).toBe('room@conference.shakespeare.lit'); - await test_utils.openChatRoom(_converse, 'lounge', 'localhost', 'dummy'); + await test_utils.openChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room"); expect(room_els.length).toBe(2); @@ -31,11 +31,11 @@ view.close(); room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room"); expect(room_els.length).toBe(1); - expect(room_els[0].innerText).toBe('lounge@localhost'); + expect(room_els[0].innerText).toBe('lounge@montague.lit'); list = controlbox.el.querySelector('div.rooms-list-container'); test_utils.waitUntil(() => _.includes(list.classList, 'hidden')); - view = _converse.chatboxviews.get('lounge@localhost'); + view = _converse.chatboxviews.get('lounge@montague.lit'); view.close(); room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room"); expect(room_els.length).toBe(0); @@ -51,18 +51,18 @@ {'connection': ['send']}, ['rosterGroupsFetched', 'chatBoxesFetched'], {'view_mode': 'fullscreen'}, async function (done, _converse) { - await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); - const view = _converse.chatboxviews.get('lounge@localhost'); + await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo'); + const view = _converse.chatboxviews.get('lounge@montague.lit'); - const contact_jid = 'newguy@localhost'; + const contact_jid = 'newguy@montague.lit'; let stanza = $pres({ - to: 'dummy@localhost/resource', - from: 'lounge@localhost/newguy' + to: 'romeo@montague.lit/orchard', + from: 'lounge@montague.lit/newguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }).tree(); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -82,7 +82,7 @@ ).pop() ); expect(Strophe.serialize(call.args[0])).toBe( - ``+ + ``+ ''+ ''+ ''+ @@ -95,7 +95,7 @@ .c('storage', {'xmlns': 'storage:bookmarks'}) .c('conference', { 'name': 'Bookmarked Lounge', - 'jid': 'lounge@localhost' + 'jid': 'lounge@montague.lit' }); _converse.connection._dataRecv(test_utils.createRequest(stanza)); @@ -161,7 +161,7 @@ const features_stanza = $iq({ 'from': 'coven@chat.shakespeare.lit', 'id': IQ_id, - 'to': 'dummy@localhost/desktop', + 'to': 'romeo@montague.lit/desktop', 'type': 'result' }) .c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'}) @@ -222,13 +222,13 @@ 'Not moderated - Participants entering this groupchat can write right away' ); presence = $pres({ - to: 'dummy@localhost/_converse.js-29092160', + to: 'romeo@montague.lit/_converse.js-29092160', from: 'coven@chat.shakespeare.lit/newguy' }) .c('x', {xmlns: Strophe.NS.MUC_USER}) .c('item', { 'affiliation': 'none', - 'jid': 'newguy@localhost/_converse.js-290929789', + 'jid': 'newguy@montague.lit/_converse.js-290929789', 'role': 'participant' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); @@ -282,13 +282,13 @@ await test_utils.openAndEnterChatRoom(_converse, 'kitchen', 'conference.shakespeare.lit', 'romeo'); const view = _converse.chatboxviews.get(room_jid); view.model.set({'minimized': true}); - const contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[5].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const nick = mock.chatroom_names[0]; await view.model.onMessage( $msg({ from: room_jid+'/'+nick, id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t('foo').tree()); @@ -301,7 +301,7 @@ $msg({ from: room_jid+'/'+nick, id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t('romeo: Your attention is required').tree() ); @@ -313,7 +313,7 @@ $msg({ from: room_jid+'/'+nick, id: (new Date()).getTime(), - to: 'dummy@localhost', + to: 'romeo@montague.lit', type: 'groupchat' }).c('body').t('romeo: and another thing...').tree() ); diff --git a/spec/roster.js b/spec/roster.js index e6b4d6236..09809d97f 100644 --- a/spec/roster.js +++ b/spec/roster.js @@ -150,32 +150,30 @@ const contacts = await test_utils.waitUntil(() => (sizzle('li', roster).filter(u.isVisible).length === 15), 600); expect(sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).length).toBe(5); - filter.value = "candice"; + filter.value = "juliet"; u.triggerEvent(filter, "keydown", "KeyboardEvent"); await test_utils.waitUntil(() => (sizzle('li', roster).filter(u.isVisible).length === 1), 600); // Only one roster contact is now visible let visible_contacts = sizzle('li', roster).filter(u.isVisible); expect(visible_contacts.length).toBe(1); - expect(visible_contacts.pop().textContent.trim()).toBe('Candice van der Knijff'); + expect(visible_contacts.pop().textContent.trim()).toBe('Juliet Capulet'); // Only one foster group is still visible expect(sizzle('.roster-group', roster).filter(u.isVisible).length).toBe(1); const visible_group = sizzle('.roster-group', roster).filter(u.isVisible).pop(); expect(visible_group.querySelector('a.group-toggle').textContent.trim()).toBe('colleagues'); filter = _converse.rosterview.el.querySelector('.roster-filter'); - filter.value = "an"; + filter.value = "j"; u.triggerEvent(filter, "keydown", "KeyboardEvent"); - await test_utils.waitUntil(() => (sizzle('li', roster).filter(u.isVisible).length === 5), 600); + await test_utils.waitUntil(() => (sizzle('li', roster).filter(u.isVisible).length === 2), 700); visible_contacts = sizzle('li', roster).filter(u.isVisible); - expect(visible_contacts.length).toBe(5); + expect(visible_contacts.length).toBe(2); let visible_groups = sizzle('.roster-group', roster).filter(u.isVisible).map(el => el.querySelector('a.group-toggle')); - expect(visible_groups.length).toBe(4); + expect(visible_groups.length).toBe(2); expect(visible_groups[0].textContent.trim()).toBe('colleagues'); - expect(visible_groups[1].textContent.trim()).toBe('Family'); - expect(visible_groups[2].textContent.trim()).toBe('friends & acquaintences'); - expect(visible_groups[3].textContent.trim()).toBe('ænemies'); + expect(visible_groups[1].textContent.trim()).toBe('Ungrouped'); filter = _converse.rosterview.el.querySelector('.roster-filter'); filter.value = "xxx"; @@ -205,35 +203,33 @@ _converse.rosterview.filter_view.delegateEvents(); await test_utils.waitUntil(() => (sizzle('li', roster).filter(u.isVisible).length === 15), 600); - filter.value = "an"; + filter.value = "la"; u.triggerEvent(filter, "keydown", "KeyboardEvent"); - await test_utils.waitUntil(() => (sizzle('li', roster).filter(u.isVisible).length === 5), 600); + await test_utils.waitUntil(() => (sizzle('li', roster).filter(u.isVisible).length === 3), 600); // Five roster contact is now visible const visible_contacts = sizzle('li', roster).filter(u.isVisible); - expect(visible_contacts.length).toBe(5); + expect(visible_contacts.length).toBe(3); let visible_groups = sizzle('.roster-group', roster).filter(u.isVisible).map(el => el.querySelector('a.group-toggle')); - expect(visible_groups.length).toBe(4); + expect(visible_groups.length).toBe(3); expect(visible_groups[0].textContent.trim()).toBe('colleagues'); expect(visible_groups[1].textContent.trim()).toBe('Family'); expect(visible_groups[2].textContent.trim()).toBe('friends & acquaintences'); - expect(visible_groups[3].textContent.trim()).toBe('ænemies'); _converse.roster.create({ - jid: 'latecomer@localhost', + jid: 'valentine@montague.lit', subscription: 'both', ask: null, groups: ['newgroup'], - fullname: 'Marty McLatecomer' + fullname: 'Valentine' }); await test_utils.waitUntil(() => sizzle('.roster-group[data-group="newgroup"] li', roster).length, 300); visible_groups = sizzle('.roster-group', roster).filter(u.isVisible).map(el => el.querySelector('a.group-toggle')); // The "newgroup" group doesn't appear - expect(visible_groups.length).toBe(4); + expect(visible_groups.length).toBe(3); expect(visible_groups[0].textContent.trim()).toBe('colleagues'); expect(visible_groups[1].textContent.trim()).toBe('Family'); expect(visible_groups[2].textContent.trim()).toBe('friends & acquaintences'); - expect(visible_groups[3].textContent.trim()).toBe('ænemies'); expect(roster.querySelectorAll('.roster-group').length).toBe(6); done(); })); @@ -310,9 +306,9 @@ async function (done, _converse) { test_utils.createGroupedContacts(_converse); - let jid = mock.cur_names[3].replace(/ /g,'.').toLowerCase() + '@localhost'; + let jid = mock.cur_names[3].replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.roster.get(jid).presence.set('show', 'online'); - jid = mock.cur_names[4].replace(/ /g,'.').toLowerCase() + '@localhost'; + jid = mock.cur_names[4].replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.roster.get(jid).presence.set('show', 'dnd'); test_utils.openControlBox(); const button = _converse.rosterview.el.querySelector('span[data-type="state"]'); @@ -325,13 +321,13 @@ u.triggerEvent(filter, 'change'); await test_utils.waitUntil(() => sizzle('li', roster).filter(u.isVisible).length === 1, 900); - expect(sizzle('li', roster).filter(u.isVisible).pop().textContent.trim()).toBe('Rinse Sommer'); + expect(sizzle('li', roster).filter(u.isVisible).pop().textContent.trim()).toBe('Lord Montague'); await test_utils.waitUntil(() => sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).length === 1, 900); const ul = sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).pop(); expect(ul.parentElement.firstElementChild.textContent.trim()).toBe('friends & acquaintences'); filter.value = "dnd"; u.triggerEvent(filter, 'change'); - await test_utils.waitUntil(() => sizzle('li', roster).filter(u.isVisible).pop().textContent.trim() === 'Annegreet Gomez', 900); + await test_utils.waitUntil(() => sizzle('li', roster).filter(u.isVisible).pop().textContent.trim() === 'Friar Laurence', 900); expect(sizzle('ul.roster-group-contacts', roster).filter(u.isVisible).length).toBe(1); done(); })); @@ -389,7 +385,7 @@ test_utils.openControlBox(); _converse.roster.create({ - jid: 'groupchanger@localhost', + jid: 'groupchanger@montague.lit', subscription: 'both', ask: null, groups: ['firstgroup'], @@ -408,7 +404,7 @@ }, 1000); expect(group_titles).toEqual(['firstgroup']); - const contact = _converse.roster.get('groupchanger@localhost'); + const contact = _converse.roster.get('groupchanger@montague.lit'); contact.set({'groups': ['secondgroup']}); group_titles = await test_utils.waitUntil(() => { const toggles = sizzle('.roster-group[data-group="secondgroup"] a.group-toggle', _converse.rosterview.el); @@ -433,7 +429,7 @@ _converse.rosterview.render(); for (var i=0; i`+ ``+ - ``+ + ``+ ``+ ``); done(); @@ -599,7 +595,7 @@ test_utils.openControlBox(); const name = mock.pend_names[0]; _converse.roster.create({ - jid: name.replace(/ /g,'.').toLowerCase() + '@localhost', + jid: name.replace(/ /g,'.').toLowerCase() + '@montague.lit', subscription: 'none', ask: 'subscribe', fullname: name @@ -619,11 +615,11 @@ expect(Strophe.serialize(iq)).toBe( ``+ ``+ - ``+ + ``+ ``+ ``); - const stanza = u.toStanza(``); + const stanza = u.toStanza(``); _converse.connection._dataRecv(test_utils.createRequest(stanza)); await test_utils.waitUntil(() => !u.isVisible(_converse.rosterview.get('Pending contacts').el)); done(); @@ -655,7 +651,7 @@ spyOn(_converse.rosterview, 'update').and.callThrough(); for (i=0; i sizzle('li', _converse.rosterview.el).filter(u.isVisible).length, 500); _converse.rosterview.el.querySelector('.roster-group a.group-toggle').click(); - const name = "Max Mustermann"; - const jid = name.replace(/ /g,'.').toLowerCase() + '@localhost'; + const name = "Romeo Montague"; + const jid = name.replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.roster.create({ ask: null, fullname: name, @@ -721,7 +717,7 @@ spyOn(_converse.rosterview, 'update').and.callThrough(); for (i=0; i _converse.rosterview.el.querySelectorAll('li').length); const name = mock.cur_names[0]; - const jid = name.replace(/ /g,'.').toLowerCase() + '@localhost'; + const jid = name.replace(/ /g,'.').toLowerCase() + '@montague.lit'; const contact = _converse.roster.get(jid); spyOn(window, 'confirm').and.returnValue(true); spyOn(contact, 'removeFromRoster').and.callThrough(); @@ -761,7 +757,7 @@ expect(window.confirm).toHaveBeenCalled(); expect(sent_IQ.toLocaleString()).toBe( ``+ - ``+ + ``+ ``); expect(contact.removeFromRoster).toHaveBeenCalled(); await test_utils.waitUntil(() => sizzle(".open-chat:contains('"+name+"')", _converse.rosterview.el).length === 0); @@ -777,7 +773,7 @@ var name = mock.cur_names[0]; var contact; contact = _converse.roster.create({ - jid: name.replace(/ /g,'.').toLowerCase() + '@localhost', + jid: name.replace(/ /g,'.').toLowerCase() + '@montague.lit', subscription: 'both', ask: null, fullname: name @@ -808,7 +804,7 @@ spyOn(_converse.rosterview, 'update').and.callThrough(); const roster = _converse.rosterview.el; for (let i=0; i sizzle('.roster-group li', _converse.rosterview.el).length, 700); let i, jid; for (i=0; i<3; i++) { - jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost'; + jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.roster.get(jid).presence.set('show', 'online'); } for (i=3; i<6; i++) { - jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost'; + jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.roster.get(jid).presence.set('show', 'dnd'); } for (i=6; i<9; i++) { - jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost'; + jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.roster.get(jid).presence.set('show', 'away'); } for (i=9; i<12; i++) { - jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost'; + jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.roster.get(jid).presence.set('show', 'xa'); } for (i=12; i<15; i++) { - jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost'; + jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@montague.lit'; _converse.roster.get(jid).presence.set('show', 'unavailable'); } await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('li.online').length) - await test_utils.waitUntil(() => _converse.rosterview.el.querySelector('li:first-child').textContent.trim() === 'Candice van der Knijff', 900); + await test_utils.waitUntil(() => _converse.rosterview.el.querySelector('li:first-child').textContent.trim() === 'Juliet Capulet', 900); const contacts = _converse.rosterview.el.querySelectorAll('.current-xmpp-contact'); for (i=0; i<3; i++) { expect(u.hasClass('online', contacts[i])).toBe(true); @@ -1007,6 +1003,7 @@ null, ['rosterGroupsFetched'], {}, async function (done, _converse) { + test_utils.openControlBox(); let names = []; const addName = function (item) { if (!u.hasClass('request-actions', item)) { @@ -1014,14 +1011,13 @@ } }; spyOn(_converse.rosterview, 'update').and.callThrough(); - spyOn(_converse.controlboxtoggle, 'showControlBox').and.callThrough(); for (let i=0; i _converse.rosterview.get('Contact requests').el.querySelectorAll('li').length, 700); @@ -1043,11 +1039,11 @@ const name = mock.req_names[0]; spyOn(window, 'confirm').and.returnValue(true); _converse.roster.create({ - jid: name.replace(/ /g,'.').toLowerCase() + '@localhost', - subscription: 'none', - ask: null, - requesting: true, - fullname: name + 'jid': name.replace(/ /g,'.').toLowerCase() + '@montague.lit', + 'subscription': 'none', + 'ask': null, + 'requesting': true, + 'nickname': name }); await test_utils.waitUntil(() => sizzle('.roster-group', _converse.rosterview.el).filter(u.isVisible).length, 900); expect(u.isVisible(_converse.rosterview.get('Contact requests').el)).toEqual(true); @@ -1080,7 +1076,7 @@ test_utils.openControlBox(); test_utils.createContacts(_converse, 'requesting').openControlBox(); const name = mock.req_names.sort()[0]; - const jid = name.replace(/ /g,'.').toLowerCase() + '@localhost'; + const jid = name.replace(/ /g,'.').toLowerCase() + '@montague.lit'; const contact = _converse.roster.get(jid); spyOn(contact, 'authorize').and.callFake(() => contact); await test_utils.waitUntil(() => _converse.rosterview.el.querySelectorAll('.roster-group li').length) @@ -1088,7 +1084,7 @@ // actually not accepted/authorized because of // mock_connection. spyOn(_converse.roster, 'sendContactAddIQ').and.callFake(() => Promise.resolve()); - const req_contact = sizzle(".req-contact-name:contains('"+name+"')", _converse.rosterview.el).pop(); + const req_contact = sizzle(`.req-contact-name:contains("${contact.getDisplayName()}")`, _converse.rosterview.el).pop(); req_contact.parentElement.parentElement.querySelector('.accept-xmpp-request').click(); expect(_converse.roster.sendContactAddIQ).toHaveBeenCalled(); await test_utils.waitUntil(() => contact.authorize.calls.count()); @@ -1105,7 +1101,7 @@ await test_utils.waitUntil(() => sizzle('.roster-group li', _converse.rosterview.el).length, 700); _converse.rosterview.update(); // XXX: Hack to make sure $roster element is attaced. const name = mock.req_names.sort()[1]; - const jid = name.replace(/ /g,'.').toLowerCase() + '@localhost'; + const jid = name.replace(/ /g,'.').toLowerCase() + '@montague.lit'; const contact = _converse.roster.get(jid); spyOn(window, 'confirm').and.returnValue(true); spyOn(contact, 'unauthorize').and.callFake(function () { return contact; }); @@ -1199,7 +1195,7 @@ await test_utils.waitUntil(() => sizzle('.roster-group li', _converse.rosterview.el).length, 700); for (let i=0; i sent_stanzas.filter(s => (s.tagName === 'enable')).pop()); @@ -41,7 +41,7 @@ let iq = IQ_stanzas.pop(); expect(Strophe.serialize(iq)).toBe( - ``+ + ``+ ``); iq = IQ_stanzas.pop(); @@ -50,12 +50,12 @@ iq = IQ_stanzas.pop(); expect(Strophe.serialize(iq)).toBe( - ``+ + ``+ ``); const disco_iq = IQ_stanzas.pop(); expect(Strophe.serialize(disco_iq)).toBe( - ``+ + ``+ ``); expect(sent_stanzas.filter(s => (s.nodeName === 'r')).length).toBe(2); @@ -74,8 +74,8 @@ const disco_result = $iq({ 'type': 'result', - 'from': 'localhost', - 'to': 'dummy@localhost/resource', + 'from': 'montague.lit', + 'to': 'romeo@montague.lit/orchard', 'id': disco_iq.getAttribute('id'), }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'}) .c('identity', { @@ -115,7 +115,7 @@ // Test that unacked stanzas get resent out iq = IQ_stanzas.pop(); expect(Strophe.serialize(iq)).toBe( - ``+ + ``+ ``); iq = IQ_stanzas.pop(); diff --git a/spec/spoilers.js b/spec/spoilers.js index d2fb9080a..c7a44a0d0 100644 --- a/spec/spoilers.js +++ b/spec/spoilers.js @@ -15,7 +15,7 @@ async (done, _converse) => { await test_utils.waitForRoster(_converse, 'current'); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; /* * And at the end of the story, both of them die! It is so tragic! @@ -38,8 +38,8 @@ await test_utils.waitUntil(() => _converse.api.chats.get().length === 2); const view = _converse.chatboxviews.get(sender_jid); - await test_utils.waitUntil(() => view.model.vcard.get('fullname') === 'Max Frankfurter') - expect(view.el.querySelector('.chat-msg__author').textContent.trim()).toBe('Max Frankfurter'); + await test_utils.waitUntil(() => view.model.vcard.get('fullname') === 'Mercutio') + expect(view.el.querySelector('.chat-msg__author').textContent.trim()).toBe('Mercutio'); const message_content = view.el.querySelector('.chat-msg__text'); expect(message_content.textContent).toBe(spoiler); const spoiler_hint_el = view.el.querySelector('.spoiler-hint'); @@ -53,7 +53,7 @@ async (done, _converse) => { await test_utils.waitForRoster(_converse, 'current'); - const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const sender_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; /* * And at the end of the story, both of them die! It is so tragic! * Love story end @@ -72,8 +72,8 @@ await _converse.chatboxes.onMessage(msg); await test_utils.waitUntil(() => _converse.api.chats.get().length === 2); const view = _converse.chatboxviews.get(sender_jid); - await test_utils.waitUntil(() => view.model.vcard.get('fullname') === 'Max Frankfurter') - expect(_.includes(view.el.querySelector('.chat-msg__author').textContent, 'Max Frankfurter')).toBeTruthy(); + await test_utils.waitUntil(() => view.model.vcard.get('fullname') === 'Mercutio') + expect(_.includes(view.el.querySelector('.chat-msg__author').textContent, 'Mercutio')).toBeTruthy(); const message_content = view.el.querySelector('.chat-msg__text'); expect(message_content.textContent).toBe(spoiler); const spoiler_hint_el = view.el.querySelector('.spoiler-hint'); @@ -88,7 +88,7 @@ await test_utils.waitForRoster(_converse, 'current', 1); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; // XXX: We need to send a presence from the contact, so that we // have a resource, that resource is then queried to see @@ -96,7 +96,7 @@ // the spoiler button will appear. const presence = $pres({ 'from': contact_jid+'/phone', - 'to': 'dummy@localhost' + 'to': 'romeo@montague.lit' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); await test_utils.openChatBoxFor(_converse, contact_jid); @@ -119,8 +119,8 @@ /* Test the XML stanza * - * @@ -138,7 +138,7 @@ expect(body_el.textContent).toBe('This is the spoiler'); /* Test the HTML spoiler message */ - expect(view.el.querySelector('.chat-msg__author').textContent.trim()).toBe('Max Mustermann'); + expect(view.el.querySelector('.chat-msg__author').textContent.trim()).toBe('Romeo Montague'); const spoiler_msg_el = view.el.querySelector('.chat-msg__text.spoiler'); expect(spoiler_msg_el.textContent).toBe('This is the spoiler'); @@ -161,7 +161,7 @@ await test_utils.waitForRoster(_converse, 'current', 1); test_utils.openControlBox(); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; // XXX: We need to send a presence from the contact, so that we // have a resource, that resource is then queried to see @@ -169,7 +169,7 @@ // the spoiler button will appear. const presence = $pres({ 'from': contact_jid+'/phone', - 'to': 'dummy@localhost' + 'to': 'romeo@montague.lit' }); _converse.connection._dataRecv(test_utils.createRequest(presence)); await test_utils.openChatBoxFor(_converse, contact_jid); @@ -196,8 +196,8 @@ /* Test the XML stanza * - * @@ -216,7 +216,7 @@ expect(body_el.textContent).toBe('This is the spoiler'); /* Test the HTML spoiler message */ - expect(view.el.querySelector('.chat-msg__author').textContent.trim()).toBe('Max Mustermann'); + expect(view.el.querySelector('.chat-msg__author').textContent.trim()).toBe('Romeo Montague'); const spoiler_msg_el = view.el.querySelector('.chat-msg__text.spoiler'); expect(spoiler_msg_el.textContent).toBe('This is the spoiler'); diff --git a/spec/transcripts.js b/spec/transcripts.js index eb7f535b5..19fad4409 100644 --- a/spec/transcripts.js +++ b/spec/transcripts.js @@ -55,7 +55,7 @@ _converse.allow_non_roster_messaging = true; - test_utils.openAndEnterChatRoom(_converse, 'discuss', 'conference.conversejs.org', 'dummy').then(function () { + test_utils.openAndEnterChatRoom(_converse, 'discuss', 'conference.conversejs.org', 'romeo').then(function () { spyOn(_converse, 'areDesktopNotificationsEnabled').and.returnValue(true); _.each(transcripts, function (transcript) { var text = transcript(); diff --git a/spec/user-details-modal.js b/spec/user-details-modal.js index f0c933fcb..02cfd283d 100644 --- a/spec/user-details-modal.js +++ b/spec/user-details-modal.js @@ -22,7 +22,7 @@ test_utils.createContacts(_converse, 'current'); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; test_utils.openChatBoxFor(_converse, contact_jid); await test_utils.waitUntil(() => _converse.chatboxes.length > 1); const view = _converse.chatboxviews.get(contact_jid); @@ -55,7 +55,7 @@ test_utils.createContacts(_converse, 'current'); _converse.api.trigger('rosterContactsFetched'); - const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; + const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; await test_utils.openChatBoxFor(_converse, contact_jid) const view = _converse.chatboxviews.get(contact_jid); let show_modal_button = view.el.querySelector('.show-user-details-modal'); @@ -75,7 +75,7 @@ const header = document.querySelector('.alert-danger .modal-title'); expect(header.textContent).toBe("Error"); expect(u.ancestor(header, '.modal-content').querySelector('.modal-body p').textContent.trim()) - .toBe("Sorry, there was an error while trying to remove Max Frankfurter as a contact."); + .toBe("Sorry, there was an error while trying to remove Mercutio as a contact."); document.querySelector('.alert-danger button.close').click(); show_modal_button = view.el.querySelector('.show-user-details-modal'); show_modal_button.click(); diff --git a/src/headless/converse-core.js b/src/headless/converse-core.js index ac132fd6b..6ae2aa597 100644 --- a/src/headless/converse-core.js +++ b/src/headless/converse-core.js @@ -1524,7 +1524,7 @@ _converse.api = { * @example * converse.plugins.add('myplugin', { * initialize: function () { - * this._converse.api.user.login('dummy@example.com', 'secret'); + * this._converse.api.user.login('romeo@montague.lit', 'secret'); * } * }); */ diff --git a/tests/mock.js b/tests/mock.js index d5da5148e..2ca7774e0 100644 --- a/tests/mock.js +++ b/tests/mock.js @@ -71,15 +71,15 @@ // Names from http://www.fakenamegenerator.com/ mock.req_names = [ - 'Louw Spekman', 'Mohamad Stet', 'Dominik Beyer' + 'Escalus, Prince of Verona', 'The Nurse', 'Paris' ]; mock.pend_names = [ - 'Suleyman van Beusichem', 'Nanja van Yperen', 'Nicole Diederich' + 'Lord Capulet', 'Lady Capulet', 'Servant' ]; mock.cur_names = [ - 'Max Frankfurter', 'Candice van der Knijff', 'Irini Vlastuin', 'Rinse Sommer', 'Annegreet Gomez', - 'Robin Schook', 'Marcel Eberhardt', 'Simone Brauer', 'Asmaa Haakman', 'Felix Amsel', - 'Lena Grunewald', 'Laura Grunewald', 'Mandy Seiler', 'Sven Bosch', 'Nuriye Cuypers' + 'Mercutio', 'Juliet Capulet', 'Lady Montague', 'Lord Montague', 'Friar Laurence', + 'Tybalt', 'Lady Capulet', 'Benviolo', 'Balthasar', + 'Peter', 'Abram', 'Sampson', 'Gregory', 'Potpan', 'Friar John' ]; mock.num_contacts = mock.req_names.length + mock.pend_names.length + mock.cur_names.length; @@ -154,7 +154,7 @@ c._proto._connect = function () { c.connected = true; c.mock = true; - c.jid = 'dummy@localhost/resource'; + c.jid = 'romeo@montague.lit/orchard'; c._changeConnectStatus(Strophe.Status.BINDREQUIRED); }; @@ -190,7 +190,7 @@ 'i18n': 'en', 'auto_subscribe': false, 'play_sounds': false, - 'bosh_service_url': 'localhost', + 'bosh_service_url': 'montague.lit/http-bind', 'connection': connection, 'animate': false, 'use_emojione': false, @@ -214,9 +214,9 @@ jid = model.get('jid') || model.get('muc_jid'); } let fullname; - if (!jid || jid == 'dummy@localhost') { - jid = 'dummy@localhost'; - fullname = 'Max Mustermann' ; + if (!jid || jid == 'romeo@montague.lit') { + jid = 'romeo@montague.lit'; + fullname = 'Romeo Montague' ; } else { const name = jid.split('@')[0].replace(/\./g, ' ').split(' '); const last = name.length-1; @@ -238,7 +238,7 @@ }).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL)); }; if (_.get(settings, 'auto_login') !== false) { - _converse.api.user.login('dummy@localhost', 'secret'); + _converse.api.user.login('romeo@montague.lit', 'secret'); await _converse.api.waitUntil('afterResourceBinding'); } window.converse_disable_effects = true; diff --git a/tests/runner.js b/tests/runner.js index eb44979a0..559ff1cff 100644 --- a/tests/runner.js +++ b/tests/runner.js @@ -34,11 +34,11 @@ var specs = [ "jasmine", //"spec/transcripts", "spec/spoilers", + "spec/roomslist", "spec/profiling", "spec/utils", "spec/converse", "spec/bookmarks", - "spec/roomslist", "spec/headline", "spec/disco", "spec/protocol", diff --git a/tests/utils.js b/tests/utils.js index 85c0c2e58..ef1833bf8 100644 --- a/tests/utils.js +++ b/tests/utils.js @@ -25,7 +25,7 @@ const stanza = $iq({ 'type': 'result', 'from': entity_jid, - 'to': 'dummy@localhost/resource', + 'to': 'romeo@montague.lit/orchard', 'id': iq.getAttribute('id'), }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#'+type}); @@ -86,7 +86,7 @@ utils.openChatBoxes = function (converse, amount) { var i = 0, jid, views = []; for (i; i result.c('item', { - jid: name.replace(/ /g,'.').toLowerCase() + '@localhost', + jid: name.replace(/ /g,'.').toLowerCase() + '@montague.lit', name: include_nick ? name : undefined, subscription: 'to' }).up() @@ -293,7 +293,7 @@ } else if (type === 'current' || type === 'all') { mock.cur_names.slice(0, length).map(name => result.c('item', { - jid: name.replace(/ /g,'.').toLowerCase() + '@localhost', + jid: name.replace(/ /g,'.').toLowerCase() + '@montague.lit', name: include_nick ? name : undefined, subscription: 'both' }).up() @@ -311,11 +311,11 @@ j = i; for (i=j; i