Commit 737e27c7 authored by JC Brand's avatar JC Brand

Use shakespearean character names in tests

parent 5738b374
...@@ -13,15 +13,15 @@ ...@@ -13,15 +13,15 @@
}); });
it("Show a chat room", function () { it("Show a chat room", function () {
test_utils.openChatRoom('lounge', 'localhost', 'dummy'); test_utils.openChatRoom('lounge', 'mongague.lit', 'romeo');
var view = converse.chatboxviews.get('lounge@localhost'); var view = converse.chatboxviews.get('lounge@mongague.lit');
if (!view.$el.find('.chat-area').length) { view.renderChatArea(); } if (!view.$el.find('.chat-area').length) { view.renderChatArea(); }
var text = 'This is a sent message'; var text = 'This is a sent message';
view.$el.find('.chat-textarea').text(text); view.$el.find('.chat-textarea').text(text);
view.$el.find('textarea.chat-textarea').trigger($.Event('keypress', {keyCode: 13})); view.$el.find('textarea.chat-textarea').trigger($.Event('keypress', {keyCode: 13}));
var message = $msg({ var message = $msg({
from: 'lounge@localhost/dummy', from: 'lounge@mongague.lit/romeo',
to: 'dummy@localhost.com', to: 'romeo@mongague.lit.com',
type: 'groupchat', type: 'groupchat',
id: view.model.messages.at(0).get('msgid') id: view.model.messages.at(0).get('msgid')
}).c('body').t(text); }).c('body').t(text);
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
var nick = mock.chatroom_names[0]; var nick = mock.chatroom_names[0];
text = 'This is a received message'; text = 'This is a received message';
message = $msg({ message = $msg({
from: 'lounge@localhost/'+nick, from: 'lounge@mongague.lit/'+nick,
id: '1', id: '1',
to: 'dummy@localhost', to: 'romeo@mongague.lit',
type: 'groupchat' type: 'groupchat'
}).c('body').t(text); }).c('body').t(text);
view.onChatRoomMessage(message.nodeTree); view.onChatRoomMessage(message.nodeTree);
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
$msg({ $msg({
'type': 'headline', 'type': 'headline',
'from': 'notify.example.com', 'from': 'notify.example.com',
'to': 'dummy@localhost', 'to': 'romeo@mongague.lit',
'xml:lang': 'en' 'xml:lang': 'en'
}) })
.c('subject').t('MAIL').up() .c('subject').t('MAIL').up()
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
}); });
xit("Show a private chat box", function () { 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 chatbox = test_utils.openChatBoxFor(contact_jid);
var view = converse.chatboxviews.get(contact_jid); var view = converse.chatboxviews.get(contact_jid);
var message = 'This message is sent from this chatbox'; var message = 'This message is sent from this chatbox';
......
...@@ -20,19 +20,19 @@ ...@@ -20,19 +20,19 @@
null, ['rosterGroupsFetched'], {}, null, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'tom'); await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'tom');
const view = _converse.chatboxviews.get('lounge@localhost'); const view = _converse.chatboxviews.get('lounge@montague.lit');
['dick', 'harry'].forEach((nick) => { ['dick', 'harry'].forEach((nick) => {
_converse.connection._dataRecv(test_utils.createRequest( _converse.connection._dataRecv(test_utils.createRequest(
$pres({ $pres({
'to': 'tom@localhost/resource', 'to': 'tom@montague.lit/resource',
'from': `lounge@localhost/${nick}` 'from': `lounge@montague.lit/${nick}`
}) })
.c('x', {xmlns: Strophe.NS.MUC_USER}) .c('x', {xmlns: Strophe.NS.MUC_USER})
.c('item', { .c('item', {
'affiliation': 'none', 'affiliation': 'none',
'jid': `${nick}@localhost/resource`, 'jid': `${nick}@montague.lit/resource`,
'role': 'participant' 'role': 'participant'
}))); })));
}); });
...@@ -62,17 +62,17 @@ ...@@ -62,17 +62,17 @@
null, ['rosterGroupsFetched'], {}, null, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo');
const view = _converse.chatboxviews.get('lounge@localhost'); const view = _converse.chatboxviews.get('lounge@montague.lit');
expect(view.model.occupants.length).toBe(1); expect(view.model.occupants.length).toBe(1);
let presence = $pres({ let presence = $pres({
'to': 'dummy@localhost/resource', 'to': 'romeo@montague.lit/orchard',
'from': 'lounge@localhost/some1' 'from': 'lounge@montague.lit/some1'
}) })
.c('x', {xmlns: Strophe.NS.MUC_USER}) .c('x', {xmlns: Strophe.NS.MUC_USER})
.c('item', { .c('item', {
'affiliation': 'none', 'affiliation': 'none',
'jid': 'some1@localhost/resource', 'jid': 'some1@montague.lit/resource',
'role': 'participant' 'role': 'participant'
}); });
_converse.connection._dataRecv(test_utils.createRequest(presence)); _converse.connection._dataRecv(test_utils.createRequest(presence));
...@@ -109,13 +109,13 @@ ...@@ -109,13 +109,13 @@
expect(view.el.querySelector('.suggestion-box__results').hidden).toBeTruthy(); expect(view.el.querySelector('.suggestion-box__results').hidden).toBeTruthy();
presence = $pres({ presence = $pres({
'to': 'dummy@localhost/resource', 'to': 'romeo@montague.lit/orchard',
'from': 'lounge@localhost/some2' 'from': 'lounge@montague.lit/some2'
}) })
.c('x', {xmlns: Strophe.NS.MUC_USER}) .c('x', {xmlns: Strophe.NS.MUC_USER})
.c('item', { .c('item', {
'affiliation': 'none', 'affiliation': 'none',
'jid': 'some2@localhost/resource', 'jid': 'some2@montague.lit/resource',
'role': 'participant' 'role': 'participant'
}); });
_converse.connection._dataRecv(test_utils.createRequest(presence)); _converse.connection._dataRecv(test_utils.createRequest(presence));
...@@ -148,13 +148,13 @@ ...@@ -148,13 +148,13 @@
// Test that pressing tab twice selects // Test that pressing tab twice selects
presence = $pres({ presence = $pres({
'to': 'dummy@localhost/resource', 'to': 'romeo@montague.lit/orchard',
'from': 'lounge@localhost/z3r0' 'from': 'lounge@montague.lit/z3r0'
}) })
.c('x', {xmlns: Strophe.NS.MUC_USER}) .c('x', {xmlns: Strophe.NS.MUC_USER})
.c('item', { .c('item', {
'affiliation': 'none', 'affiliation': 'none',
'jid': 'z3r0@localhost/resource', 'jid': 'z3r0@montague.lit/resource',
'role': 'participant' 'role': 'participant'
}); });
_converse.connection._dataRecv(test_utils.createRequest(presence)); _converse.connection._dataRecv(test_utils.createRequest(presence));
...@@ -173,17 +173,17 @@ ...@@ -173,17 +173,17 @@
null, ['rosterGroupsFetched'], {}, null, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo');
const view = _converse.chatboxviews.get('lounge@localhost'); const view = _converse.chatboxviews.get('lounge@montague.lit');
expect(view.model.occupants.length).toBe(1); expect(view.model.occupants.length).toBe(1);
const presence = $pres({ const presence = $pres({
'to': 'dummy@localhost/resource', 'to': 'romeo@montague.lit/orchard',
'from': 'lounge@localhost/some1' 'from': 'lounge@montague.lit/some1'
}) })
.c('x', {xmlns: Strophe.NS.MUC_USER}) .c('x', {xmlns: Strophe.NS.MUC_USER})
.c('item', { .c('item', {
'affiliation': 'none', 'affiliation': 'none',
'jid': 'some1@localhost/resource', 'jid': 'some1@montague.lit/resource',
'role': 'participant' 'role': 'participant'
}); });
_converse.connection._dataRecv(test_utils.createRequest(presence)); _converse.connection._dataRecv(test_utils.createRequest(presence));
......
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
await test_utils.waitUntil(() => sent_stanza); await test_utils.waitUntil(() => sent_stanza);
expect(sent_stanza.toLocaleString()).toBe( expect(sent_stanza.toLocaleString()).toBe(
`<iq from="dummy@localhost/resource" id="${IQ_id}" type="set" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${IQ_id}" type="set" xmlns="jabber:client">`+
`<pubsub xmlns="http://jabber.org/protocol/pubsub">`+ `<pubsub xmlns="http://jabber.org/protocol/pubsub">`+
`<publish node="storage:bookmarks">`+ `<publish node="storage:bookmarks">`+
`<item id="current">`+ `<item id="current">`+
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
['http://jabber.org/protocol/pubsub#publish-options'] ['http://jabber.org/protocol/pubsub#publish-options']
); );
await test_utils.waitUntil(() => _converse.bookmarks); await test_utils.waitUntil(() => _converse.bookmarks);
let jid = 'lounge@localhost'; let jid = 'lounge@montague.lit';
_converse.bookmarks.create({ _converse.bookmarks.create({
'jid': jid, 'jid': jid,
'autojoin': false, 'autojoin': false,
...@@ -222,8 +222,8 @@ ...@@ -222,8 +222,8 @@
[{'category': 'pubsub', 'type': 'pep'}], [{'category': 'pubsub', 'type': 'pep'}],
['http://jabber.org/protocol/pubsub#publish-options'] ['http://jabber.org/protocol/pubsub#publish-options']
); );
await _converse.api.rooms.open(`lounge@localhost`); await _converse.api.rooms.open(`lounge@montague.lit`);
const view = _converse.chatboxviews.get('lounge@localhost'); const view = _converse.chatboxviews.get('lounge@montague.lit');
let bookmark_icon = await test_utils.waitUntil(() => view.el.querySelector('.toggle-bookmark')); let bookmark_icon = await test_utils.waitUntil(() => view.el.querySelector('.toggle-bookmark'));
expect(_.includes(bookmark_icon.classList, 'button-on')).toBeFalsy(); expect(_.includes(bookmark_icon.classList, 'button-on')).toBeFalsy();
_converse.bookmarks.create({ _converse.bookmarks.create({
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
// conferences to bookmark (since we removed the one and // conferences to bookmark (since we removed the one and
// only bookmark). // only bookmark).
expect(sent_stanza.toLocaleString()).toBe( expect(sent_stanza.toLocaleString()).toBe(
`<iq from="dummy@localhost/resource" id="${IQ_id}" type="set" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${IQ_id}" type="set" xmlns="jabber:client">`+
`<pubsub xmlns="http://jabber.org/protocol/pubsub">`+ `<pubsub xmlns="http://jabber.org/protocol/pubsub">`+
`<publish node="storage:bookmarks">`+ `<publish node="storage:bookmarks">`+
`<item id="current">`+ `<item id="current">`+
...@@ -389,8 +389,8 @@ ...@@ -389,8 +389,8 @@
* </message> * </message>
*/ */
var stanza = $msg({ var stanza = $msg({
'from': 'dummy@localhost', 'from': 'romeo@montague.lit',
'to': 'dummy@localhost/resource', 'to': 'romeo@montague.lit/orchard',
'type': 'headline', 'type': 'headline',
'id': 'rnfoo1' 'id': 'rnfoo1'
}).c('event', {'xmlns': 'http://jabber.org/protocol/pubsub#event'}) }).c('event', {'xmlns': 'http://jabber.org/protocol/pubsub#event'})
...@@ -445,7 +445,7 @@ ...@@ -445,7 +445,7 @@
); );
expect(Strophe.serialize(call.args[0])).toBe( expect(Strophe.serialize(call.args[0])).toBe(
`<iq from="dummy@localhost/resource" id="${IQ_id}" type="get" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${IQ_id}" type="get" xmlns="jabber:client">`+
'<pubsub xmlns="http://jabber.org/protocol/pubsub">'+ '<pubsub xmlns="http://jabber.org/protocol/pubsub">'+
'<items node="storage:bookmarks"/>'+ '<items node="storage:bookmarks"/>'+
'</pubsub>'+ '</pubsub>'+
...@@ -528,7 +528,7 @@ ...@@ -528,7 +528,7 @@
).pop() ).pop()
); );
expect(Strophe.serialize(call.args[0])).toBe( expect(Strophe.serialize(call.args[0])).toBe(
`<iq from="dummy@localhost/resource" id="${IQ_id}" type="get" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${IQ_id}" type="get" xmlns="jabber:client">`+
'<pubsub xmlns="http://jabber.org/protocol/pubsub">'+ '<pubsub xmlns="http://jabber.org/protocol/pubsub">'+
'<items node="storage:bookmarks"/>'+ '<items node="storage:bookmarks"/>'+
'</pubsub>'+ '</pubsub>'+
...@@ -616,7 +616,7 @@ ...@@ -616,7 +616,7 @@
).pop() ).pop()
); );
expect(Strophe.serialize(call.args[0])).toBe( expect(Strophe.serialize(call.args[0])).toBe(
`<iq from="dummy@localhost/resource" id="${IQ_id}" type="get" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${IQ_id}" type="get" xmlns="jabber:client">`+
'<pubsub xmlns="http://jabber.org/protocol/pubsub">'+ '<pubsub xmlns="http://jabber.org/protocol/pubsub">'+
'<items node="storage:bookmarks"/>'+ '<items node="storage:bookmarks"/>'+
'</pubsub>'+ '</pubsub>'+
......
This diff is collapsed.
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
test_utils.openControlBox(); test_utils.openControlBox();
// Adding two contacts one with Capital initials and one with small initials of same JID (Case sensitive check) // Adding two contacts one with Capital initials and one with small initials of same JID (Case sensitive check)
_converse.roster.create({ _converse.roster.create({
jid: mock.pend_names[0].replace(/ /g,'.').toLowerCase() + '@localhost', jid: mock.pend_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit',
subscription: 'none', subscription: 'none',
ask: 'subscribe', ask: 'subscribe',
fullname: mock.pend_names[0] fullname: mock.pend_names[0]
}); });
_converse.roster.create({ _converse.roster.create({
jid: mock.pend_names[0].replace(/ /g,'.') + '@localhost', jid: mock.pend_names[0].replace(/ /g,'.') + '@montague.lit',
subscription: 'none', subscription: 'none',
ask: 'subscribe', ask: 'subscribe',
fullname: mock.pend_names[0] fullname: mock.pend_names[0]
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
test_utils.createContacts(_converse, 'all').openControlBox(); test_utils.createContacts(_converse, 'all').openControlBox();
_converse.api.trigger('rosterContactsFetched'); _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.openChatBoxFor(_converse, sender_jid);
await test_utils.waitUntil(() => _converse.chatboxes.length); await test_utils.waitUntil(() => _converse.chatboxes.length);
const chatview = _converse.chatboxviews.get(sender_jid); const chatview = _converse.chatboxviews.get(sender_jid);
...@@ -208,13 +208,13 @@ ...@@ -208,13 +208,13 @@
input_jid.value = 'someone@'; input_jid.value = 'someone@';
const evt = new Event('input'); const evt = new Event('input');
input_jid.dispatchEvent(evt); input_jid.dispatchEvent(evt);
expect(modal.el.querySelector('.suggestion-box li').textContent).toBe('someone@localhost'); expect(modal.el.querySelector('.suggestion-box li').textContent).toBe('someone@montague.lit');
input_jid.value = 'someone@localhost'; input_jid.value = 'someone@montague.lit';
input_name.value = 'Someone'; input_name.value = 'Someone';
modal.el.querySelector('button[type="submit"]').click(); modal.el.querySelector('button[type="submit"]').click();
expect(sent_stanza.toLocaleString()).toEqual( expect(sent_stanza.toLocaleString()).toEqual(
`<iq id="${IQ_id}" type="set" xmlns="jabber:client">`+ `<iq id="${IQ_id}" type="set" xmlns="jabber:client">`+
`<query xmlns="jabber:iq:roster"><item jid="someone@localhost" name="Someone"/></query>`+ `<query xmlns="jabber:iq:roster"><item jid="someone@montague.lit" name="Someone"/></query>`+
`</iq>`); `</iq>`);
done(); done();
})); }));
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
expect(!_.isNull(modal.el.querySelector('form.add-xmpp-contact'))).toBeTruthy(); expect(!_.isNull(modal.el.querySelector('form.add-xmpp-contact'))).toBeTruthy();
const input_jid = modal.el.querySelector('input[name="jid"]'); const input_jid = modal.el.querySelector('input[name="jid"]');
const input_name = modal.el.querySelector('input[name="name"]'); 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(); modal.el.querySelector('button[type="submit"]').click();
const IQ_stanzas = _converse.connection.IQ_stanzas; const IQ_stanzas = _converse.connection.IQ_stanzas;
...@@ -245,7 +245,7 @@ ...@@ -245,7 +245,7 @@
); );
expect(Strophe.serialize(sent_stanza)).toEqual( expect(Strophe.serialize(sent_stanza)).toEqual(
`<iq id="${sent_stanza.getAttribute('id')}" type="set" xmlns="jabber:client">`+ `<iq id="${sent_stanza.getAttribute('id')}" type="set" xmlns="jabber:client">`+
`<query xmlns="jabber:iq:roster"><item jid="someone@localhost"/></query>`+ `<query xmlns="jabber:iq:roster"><item jid="someone@montague.lit"/></query>`+
`</iq>` `</iq>`
); );
done(); done();
...@@ -324,10 +324,10 @@ ...@@ -324,10 +324,10 @@
'send': function () { 'send': function () {
const value = modal.el.querySelector('input[name="name"]').value; const value = modal.el.querySelector('input[name="name"]').value;
if (value === 'existing') { 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]}]); xhr.responseText = JSON.stringify([{"jid": contact_jid, "fullname": mock.cur_names[0]}]);
} else if (value === 'dummy') { } else if (value === 'romeo') {
xhr.responseText = JSON.stringify([{"jid": "dummy@localhost", "fullname": "Max Mustermann"}]); xhr.responseText = JSON.stringify([{"jid": "romeo@montague.lit", "fullname": "Romeo Montague"}]);
} else if (value === 'ambiguous') { } else if (value === 'ambiguous') {
xhr.responseText = JSON.stringify([ xhr.responseText = JSON.stringify([
{"jid": "marty@mcfly.net", "fullname": "Marty McFly"}, {"jid": "marty@mcfly.net", "fullname": "Marty McFly"},
...@@ -374,7 +374,7 @@ ...@@ -374,7 +374,7 @@
expect(feedback_el.textContent).toBe('Sorry, could not find a contact with that name'); expect(feedback_el.textContent).toBe('Sorry, could not find a contact with that name');
feedback_el.textContent = ''; feedback_el.textContent = '';
input_el.value = 'dummy'; input_el.value = 'romeo';
modal.el.querySelector('button[type="submit"]').click(); modal.el.querySelector('button[type="submit"]').click();
feedback_el = modal.el.querySelector('.invalid-feedback'); feedback_el = modal.el.querySelector('.invalid-feedback');
expect(feedback_el.textContent).toBe('You cannot add yourself as a contact'); expect(feedback_el.textContent).toBe('You cannot add yourself as a contact');
......
...@@ -254,16 +254,16 @@ ...@@ -254,16 +254,16 @@
let contact = await _converse.api.contacts.get('non-existing@jabber.org'); let contact = await _converse.api.contacts.get('non-existing@jabber.org');
expect(contact).toBeFalsy(); expect(contact).toBeFalsy();
// Check when a single jid is given // 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); 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); expect(contact.get('jid')).toBe(jid);
// You can retrieve multiple contacts by passing in an array // 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]); let list = await _converse.api.contacts.get([jid, jid2]);
expect(Array.isArray(list)).toBeTruthy(); expect(Array.isArray(list)).toBeTruthy();
expect(list[0].get('fullname')).toBe(mock.cur_names[0]); expect(list[0].getDisplayName()).toBe(mock.cur_names[0]);
expect(list[1].get('fullname')).toBe(mock.cur_names[1]); expect(list[1].getDisplayName()).toBe(mock.cur_names[1]);
// Check that all JIDs are returned if you call without any parameters // Check that all JIDs are returned if you call without any parameters
list = await _converse.api.contacts.get(); list = await _converse.api.contacts.get();
expect(list.length).toBe(mock.cur_names.length); expect(list.length).toBe(mock.cur_names.length);
...@@ -294,8 +294,8 @@ ...@@ -294,8 +294,8 @@
// Test on chat that doesn't exist. // Test on chat that doesn't exist.
expect(_converse.api.chats.get('non-existing@jabber.org')).toBeFalsy(); expect(_converse.api.chats.get('non-existing@jabber.org')).toBeFalsy();
const jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; const jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit';
const jid2 = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; const jid2 = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit';
// Test on chat that's not open // Test on chat that's not open
let box = _converse.api.chats.get(jid); let box = _converse.api.chats.get(jid);
...@@ -327,8 +327,8 @@ ...@@ -327,8 +327,8 @@
test_utils.createContacts(_converse, 'current', 2); test_utils.createContacts(_converse, 'current', 2);
_converse.api.trigger('rosterContactsFetched'); _converse.api.trigger('rosterContactsFetched');
const jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@localhost'; const jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit';
const jid2 = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@localhost'; const jid2 = mock.cur_names[1].replace(/ /g,'.').toLowerCase() + '@montague.lit';
// Test on chat that doesn't exist. // Test on chat that doesn't exist.
expect(_converse.api.chats.get('non-existing@jabber.org')).toBeFalsy(); expect(_converse.api.chats.get('non-existing@jabber.org')).toBeFalsy();
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
const IQ_ids = _converse.connection.IQ_ids; const IQ_ids = _converse.connection.IQ_ids;
test_utils.waitUntil(function () { test_utils.waitUntil(function () {
return _.filter(IQ_stanzas, function (iq) { 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; }).length > 0;
}, 300).then(function () { }, 300).then(function () {
/* <iq type='result' /* <iq type='result'
...@@ -52,13 +52,13 @@ ...@@ -52,13 +52,13 @@
* </iq> * </iq>
*/ */
var stanza = _.find(IQ_stanzas, function (iq) { 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)]; var info_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
stanza = $iq({ stanza = $iq({
'type': 'result', 'type': 'result',
'from': 'localhost', 'from': 'montague.lit',
'to': 'dummy@localhost/resource', 'to': 'romeo@montague.lit/orchard',
'id': info_IQ_id 'id': info_IQ_id
}).c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'}) }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'})
.c('identity', { .c('identity', {
...@@ -88,12 +88,12 @@ ...@@ -88,12 +88,12 @@
expect(entities.length).toBe(2); // We have an extra entity, which is the user's JID 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).features.length).toBe(5);
expect(entities.get(_converse.domain).identities.length).toBe(3); 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('montague.lit').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('montague.lit').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('montague.lit').features.where({'var': 'jabber:iq:register'}).length).toBe(1);
expect(entities.get('localhost').features.where( expect(entities.get('montague.lit').features.where(
{'var': 'http://jabber.org/protocol/disco#items'}).length).toBe(1); {'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); {'var': 'http://jabber.org/protocol/disco#info'}).length).toBe(1);
...@@ -131,13 +131,13 @@ ...@@ -131,13 +131,13 @@
* </iq> * </iq>
*/ */
var stanza = _.find(IQ_stanzas, function (iq) { 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)]; var items_IQ_id = IQ_ids[IQ_stanzas.indexOf(stanza)];
stanza = $iq({ stanza = $iq({
'type': 'result', 'type': 'result',
'from': 'localhost', 'from': 'montague.lit',
'to': 'dummy@localhost/resource', 'to': 'romeo@montague.lit/orchard',
'id': items_IQ_id 'id': items_IQ_id
}).c('query', {'xmlns': 'http://jabber.org/protocol/disco#items'}) }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#items'})
.c('item', { .c('item', {
...@@ -151,14 +151,14 @@ ...@@ -151,14 +151,14 @@
'name': 'Gateway to Marlowe IM'}).up() 'name': 'Gateway to Marlowe IM'}).up()
.c('item', { .c('item', {
'jid': 'localhost', 'jid': 'montague.lit',
'node': 'books', 'node': 'books',
'name': 'Books by and about Shakespeare'}).up() 'name': 'Books by and about Shakespeare'}).up()
.c('item', { .c('item', {
'node': 'localhost', 'node': 'montague.lit',
'name': 'Wear your literary taste with pride'}).up() 'name': 'Wear your literary taste with pride'}).up()
.c('item', { .c('item', {
'jid': 'localhost', 'jid': 'montague.lit',
'node': 'music', 'node': 'music',
'name': 'Music from the time of Shakespeare' 'name': 'Music from the time of Shakespeare'
}); });
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
/* XMPP spam message: /* XMPP spam message:
* *
* <message xmlns="jabber:client" * <message xmlns="jabber:client"
* to="dummy@localhost" * to="romeo@montague.lit"
* type="chat" * type="chat"
* from="gapowa20102106@rds-rostov.ru/Adium"> * from="gapowa20102106@rds-rostov.ru/Adium">
* <nick xmlns="http://jabber.org/protocol/nick">-wwdmz</nick> * <nick xmlns="http://jabber.org/protocol/nick">-wwdmz</nick>
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
sinon.spy(utils, 'isHeadlineMessage'); sinon.spy(utils, 'isHeadlineMessage');
const stanza = $msg({ const stanza = $msg({
'xmlns': 'jabber:client', 'xmlns': 'jabber:client',
'to': 'dummy@localhost', 'to': 'romeo@montague.lit',
'type': 'chat', 'type': 'chat',
'from': 'gapowa20102106@rds-rostov.ru/Adium', 'from': 'gapowa20102106@rds-rostov.ru/Adium',
}) })
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
const stanza = $msg({ const stanza = $msg({
'type': 'headline', 'type': 'headline',
'from': 'notify.example.com', 'from': 'notify.example.com',
'to': 'dummy@localhost', 'to': 'romeo@montague.lit',
'xml:lang': 'en' 'xml:lang': 'en'
}) })
.c('subject').t('SIEVE').up() .c('subject').t('SIEVE').up()
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
var stanza = $msg({ var stanza = $msg({
'type': 'headline', 'type': 'headline',
'from': 'andre5114@jabber.snc.ru/Spark', 'from': 'andre5114@jabber.snc.ru/Spark',
'to': 'dummy@localhost', 'to': 'romeo@montague.lit',
'xml:lang': 'en' 'xml:lang': 'en'
}) })
.c('nick').t('gpocy').up() .c('nick').t('gpocy').up()
......
This diff is collapsed.
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
expect(label.textContent).toBe('This is a trusted device'); expect(label.textContent).toBe('This is a trusted device');
expect(checkbox.checked).toBe(true); 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'; cbview.el.querySelector('input[name="password"]').value = 'secret';
spyOn(cbview.loginpanel, 'connect'); spyOn(cbview.loginpanel, 'connect');
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
expect(label.textContent).toBe('This is a trusted device'); expect(label.textContent).toBe('This is a trusted device');
expect(checkbox.checked).toBe(false); 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'; cbview.el.querySelector('input[name="password"]').value = 'secret';
spyOn(cbview.loginpanel, 'connect'); spyOn(cbview.loginpanel, 'connect');
......
...@@ -24,11 +24,11 @@ ...@@ -24,11 +24,11 @@
null, ['discoInitialized'], {}, null, ['discoInitialized'], {},
async function (done, _converse) { 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'); const view = _converse.chatboxviews.get('trek-radio@conference.lightwitch.org');
let stanza = u.toStanza( let stanza = u.toStanza(
`<message xmlns="jabber:client" to="dummy@localhost/resource" type="groupchat" from="trek-radio@conference.lightwitch.org/some1"> `<message xmlns="jabber:client" to="romeo@montague.lit/orchard" type="groupchat" from="trek-radio@conference.lightwitch.org/some1">
<body>Hello</body> <body>Hello</body>
<stanza-id xmlns="urn:xmpp:sid:0" id="45fbbf2a-1059-479d-9283-c8effaf05621" by="trek-radio@conference.lightwitch.org"/> <stanza-id xmlns="urn:xmpp:sid:0" id="45fbbf2a-1059-479d-9283-c8effaf05621" by="trek-radio@conference.lightwitch.org"/>
</message>`); </message>`);
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
stanza = u.toStanza( stanza = u.toStanza(
`<message xmlns="jabber:client" `<message xmlns="jabber:client"
to="dummy@localhost/resource" to="romeo@montague.lit/orchard"
from="trek-radio@conference.lightwitch.org"> from="trek-radio@conference.lightwitch.org">
<result xmlns="urn:xmpp:mam:2" queryid="82d9db27-6cf8-4787-8c2c-5a560263d823" id="45fbbf2a-1059-479d-9283-c8effaf05621"> <result xmlns="urn:xmpp:mam:2" queryid="82d9db27-6cf8-4787-8c2c-5a560263d823" id="45fbbf2a-1059-479d-9283-c8effaf05621">
<forwarded xmlns="urn:xmpp:forward:0"> <forwarded xmlns="urn:xmpp:forward:0">
...@@ -111,10 +111,10 @@ ...@@ -111,10 +111,10 @@
null, ['discoInitialized'], {}, null, ['discoInitialized'], {},
async function (done, _converse) { 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'); const view = _converse.chatboxviews.get('discuss@conference.conversejs.org');
let stanza = u.toStanza( let stanza = u.toStanza(
`<message xmlns="jabber:client" to="dummy@localhost/resource" from="discuss@conference.conversejs.org"> `<message xmlns="jabber:client" to="romeo@montague.lit/orchard" from="discuss@conference.conversejs.org">
<result xmlns="urn:xmpp:mam:2" queryid="06fea9ca-97c9-48c4-8583-009ff54ea2e8" id="7a9fde91-4387-4bf8-b5d3-978dab8f6bf3"> <result xmlns="urn:xmpp:mam:2" queryid="06fea9ca-97c9-48c4-8583-009ff54ea2e8" id="7a9fde91-4387-4bf8-b5d3-978dab8f6bf3">
<forwarded xmlns="urn:xmpp:forward:0"> <forwarded xmlns="urn:xmpp:forward:0">
<delay xmlns="urn:xmpp:delay" stamp="2018-12-05T04:53:12Z"/> <delay xmlns="urn:xmpp:delay" stamp="2018-12-05T04:53:12Z"/>
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
expect(view.content.querySelectorAll('.chat-msg').length).toBe(1); expect(view.content.querySelectorAll('.chat-msg').length).toBe(1);
stanza = u.toStanza( stanza = u.toStanza(
`<message xmlns="jabber:client" to="dummy@localhost/resource" from="discuss@conference.conversejs.org"> `<message xmlns="jabber:client" to="romeo@montague.lit/orchard" from="discuss@conference.conversejs.org">
<result xmlns="urn:xmpp:mam:2" queryid="06fea9ca-97c9-48c4-8583-009ff54ea2e8" id="7a9fde91-4387-4bf8-b5d3-978dab8f6bf3"> <result xmlns="urn:xmpp:mam:2" queryid="06fea9ca-97c9-48c4-8583-009ff54ea2e8" id="7a9fde91-4387-4bf8-b5d3-978dab8f6bf3">
<forwarded xmlns="urn:xmpp:forward:0"> <forwarded xmlns="urn:xmpp:forward:0">
<delay xmlns="urn:xmpp:delay" stamp="2018-12-05T04:53:12Z"/> <delay xmlns="urn:xmpp:delay" stamp="2018-12-05T04:53:12Z"/>
...@@ -272,13 +272,13 @@ ...@@ -272,13 +272,13 @@
* </result> * </result>
* </message> * </message>
*/ */
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('result', {'xmlns': 'urn:xmpp:mam:2', 'queryid':queryid, 'id':'34482-21985-73620'})
.c('forwarded', {'xmlns':'urn:xmpp:forward:0'}) .c('forwarded', {'xmlns':'urn:xmpp:forward:0'})
.c('delay', {'xmlns':'urn:xmpp:delay', 'stamp':'2010-07-10T23:08:25Z'}).up() .c('delay', {'xmlns':'urn:xmpp:delay', 'stamp':'2010-07-10T23:08:25Z'}).up()
.c('message', { .c('message', {
'xmlns':'jabber:client', 'xmlns':'jabber:client',
'to':'dummy@localhost', 'to':'romeo@montague.lit',
'id':'162BEBB1-F6DB-4D9A-9BD8-CFDCC801A0B2', 'id':'162BEBB1-F6DB-4D9A-9BD8-CFDCC801A0B2',
'from':'coven@chat.shakespeare.lit/firstwitch', 'from':'coven@chat.shakespeare.lit/firstwitch',
'type':'groupchat' }) 'type':'groupchat' })
...@@ -728,7 +728,7 @@ ...@@ -728,7 +728,7 @@
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current', 1); 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.openChatBoxFor(_converse, contact_jid);
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
...@@ -747,7 +747,7 @@ ...@@ -747,7 +747,7 @@
`<query queryid="${queryid}" xmlns="urn:xmpp:mam:2">`+ `<query queryid="${queryid}" xmlns="urn:xmpp:mam:2">`+
`<x type="submit" xmlns="jabber:x:data">`+ `<x type="submit" xmlns="jabber:x:data">`+
`<field type="hidden" var="FORM_TYPE"><value>urn:xmpp:mam:2</value></field>`+ `<field type="hidden" var="FORM_TYPE"><value>urn:xmpp:mam:2</value></field>`+
`<field var="with"><value>max.frankfurter@localhost</value></field>`+ `<field var="with"><value>mercutio@montague.lit</value></field>`+
`</x>`+ `</x>`+
`<set xmlns="http://jabber.org/protocol/rsm"><max>50</max><before></before></set>`+ `<set xmlns="http://jabber.org/protocol/rsm"><max>50</max><before></before></set>`+
`</query>`+ `</query>`+
......
This diff is collapsed.
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
_converse.minimized_chats.toggleview.model.browserStorage._clear(); _converse.minimized_chats.toggleview.model.browserStorage._clear();
_converse.minimized_chats.initToggle(); _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) await test_utils.openChatBoxFor(_converse, contact_jid)
let chatview = _converse.chatboxviews.get(contact_jid); let chatview = _converse.chatboxviews.get(contact_jid);
expect(chatview.model.get('minimized')).toBeFalsy(); expect(chatview.model.get('minimized')).toBeFalsy();
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
expect(_converse.minimized_chats.keys().length).toBe(1); expect(_converse.minimized_chats.keys().length).toBe(1);
expect(_converse.minimized_chats.keys()[0]).toBe(contact_jid); 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); await test_utils.openChatBoxFor(_converse, contact_jid);
chatview = _converse.chatboxviews.get(contact_jid); chatview = _converse.chatboxviews.get(contact_jid);
expect(chatview.model.get('minimized')).toBeFalsy(); expect(chatview.model.get('minimized')).toBeFalsy();
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
_converse.minimized_chats.toggleview.model.browserStorage._clear(); _converse.minimized_chats.toggleview.model.browserStorage._clear();
_converse.minimized_chats.initToggle(); _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); await test_utils.openChatBoxFor(_converse, contact_jid);
const chatview = _converse.chatboxviews.get(contact_jid); const chatview = _converse.chatboxviews.get(contact_jid);
expect(u.isVisible(_converse.minimized_chats.el)).toBeFalsy(); expect(u.isVisible(_converse.minimized_chats.el)).toBeFalsy();
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
expect(_.isNull(unread_el)).toBe(true); expect(_.isNull(unread_el)).toBe(true);
for (i=0; i<3; i++) { 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.openChatBoxFor(_converse, contact_jid);
} }
test_utils.waitUntil(() => _converse.chatboxes.length == 4).then(() => { test_utils.waitUntil(() => _converse.chatboxes.length == 4).then(() => {
...@@ -161,13 +161,13 @@ ...@@ -161,13 +161,13 @@
var view = _converse.chatboxviews.get(room_jid); var view = _converse.chatboxviews.get(room_jid);
view.model.set({'minimized': true}); 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 message = 'fires: Your attention is required';
var nick = mock.chatroom_names[0], var nick = mock.chatroom_names[0],
msg = $msg({ msg = $msg({
from: room_jid+'/'+nick, from: room_jid+'/'+nick,
id: (new Date()).getTime(), id: (new Date()).getTime(),
to: 'dummy@localhost', to: 'romeo@montague.lit',
type: 'groupchat' type: 'groupchat'
}).c('body').t(message).tree(); }).c('body').t(message).tree();
view.model.onMessage(msg); view.model.onMessage(msg);
......
This diff is collapsed.
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
spyOn(_converse, 'isMessageToHiddenChat').and.returnValue(true); spyOn(_converse, 'isMessageToHiddenChat').and.returnValue(true);
const message = 'This message will show a desktop notification'; const message = 'This message will show a desktop notification';
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({ msg = $msg({
from: sender_jid, from: sender_jid,
to: _converse.connection.jid, to: _converse.connection.jid,
...@@ -47,8 +47,8 @@ ...@@ -47,8 +47,8 @@
async (done, _converse) => { async (done, _converse) => {
await test_utils.createContacts(_converse, 'current'); await test_utils.createContacts(_converse, 'current');
await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo');
const view = _converse.api.chatviews.get('lounge@localhost'); const view = _converse.api.chatviews.get('lounge@montague.lit');
if (!view.el.querySelectorAll('.chat-area').length) { if (!view.el.querySelectorAll('.chat-area').length) {
view.renderChatArea(); view.renderChatArea();
} }
...@@ -64,12 +64,12 @@ ...@@ -64,12 +64,12 @@
spyOn(_converse, 'showMessageNotification').and.callThrough(); spyOn(_converse, 'showMessageNotification').and.callThrough();
spyOn(_converse, 'areDesktopNotificationsEnabled').and.returnValue(true); 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], const nick = mock.chatroom_names[0],
msg = $msg({ msg = $msg({
from: 'lounge@localhost/'+nick, from: 'lounge@montague.lit/'+nick,
id: (new Date()).getTime(), id: (new Date()).getTime(),
to: 'dummy@localhost', to: 'romeo@montague.lit',
type: 'groupchat' type: 'groupchat'
}).c('body').t(message).tree(); }).c('body').t(message).tree();
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
const stanza = $msg({ const stanza = $msg({
'type': 'headline', 'type': 'headline',
'from': 'notify.example.com', 'from': 'notify.example.com',
'to': 'dummy@localhost', 'to': 'romeo@montague.lit',
'xml:lang': 'en' 'xml:lang': 'en'
}) })
.c('subject').t('SIEVE').up() .c('subject').t('SIEVE').up()
...@@ -120,7 +120,7 @@ ...@@ -120,7 +120,7 @@
const stanza = $msg({ const stanza = $msg({
'type': 'headline', 'type': 'headline',
'from': 'someone@notify.example.com', 'from': 'someone@notify.example.com',
'to': 'dummy@localhost', 'to': 'romeo@montague.lit',
'xml:lang': 'en' 'xml:lang': 'en'
}) })
.c('subject').t('SIEVE').up() .c('subject').t('SIEVE').up()
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
spyOn(_converse, 'areDesktopNotificationsEnabled').and.returnValue(true); spyOn(_converse, 'areDesktopNotificationsEnabled').and.returnValue(true);
spyOn(_converse, 'showChatStateNotification'); 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' _converse.roster.get(jid).presence.set('show', 'busy'); // This will emit 'contactStatusChanged'
expect(_converse.areDesktopNotificationsEnabled).toHaveBeenCalled(); expect(_converse.areDesktopNotificationsEnabled).toHaveBeenCalled();
expect(_converse.showChatStateNotification).toHaveBeenCalled(); expect(_converse.showChatStateNotification).toHaveBeenCalled();
...@@ -173,18 +173,18 @@ ...@@ -173,18 +173,18 @@
async (done, _converse) => { async (done, _converse) => {
test_utils.createContacts(_converse, 'current'); 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; _converse.play_sounds = true;
spyOn(_converse, 'playSoundNotification'); 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) { if (!view.el.querySelectorAll('.chat-area').length) {
view.renderChatArea(); 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({ let message = $msg({
from: 'lounge@localhost/otheruser', from: 'lounge@montague.lit/otheruser',
id: '1', id: '1',
to: 'dummy@localhost', to: 'romeo@montague.lit',
type: 'groupchat' type: 'groupchat'
}).c('body').t(text); }).c('body').t(text);
await view.model.onMessage(message.nodeTree); await view.model.onMessage(message.nodeTree);
...@@ -193,20 +193,20 @@ ...@@ -193,20 +193,20 @@
text = "This message won't play a sound"; text = "This message won't play a sound";
message = $msg({ message = $msg({
from: 'lounge@localhost/otheruser', from: 'lounge@montague.lit/otheruser',
id: '2', id: '2',
to: 'dummy@localhost', to: 'romeo@montague.lit',
type: 'groupchat' type: 'groupchat'
}).c('body').t(text); }).c('body').t(text);
await view.model.onMessage(message.nodeTree); await view.model.onMessage(message.nodeTree);
expect(_converse.playSoundNotification, 1); expect(_converse.playSoundNotification, 1);
_converse.play_sounds = false; _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({ message = $msg({
from: 'lounge@localhost/dummy', from: 'lounge@montague.lit/romeo',
id: '3', id: '3',
to: 'dummy@localhost', to: 'romeo@montague.lit',
type: 'groupchat' type: 'groupchat'
}).c('body').t(text); }).c('body').t(text);
await view.model.onMessage(message.nodeTree); await view.model.onMessage(message.nodeTree);
......
This diff is collapsed.
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
}); });
_converse.ping(); _converse.ping();
expect(sent_stanza.toLocaleString()).toBe( expect(sent_stanza.toLocaleString()).toBe(
`<iq id="${IQ_id}" to="localhost" type="get" xmlns="jabber:client">`+ `<iq id="${IQ_id}" to="montague.lit" type="get" xmlns="jabber:client">`+
`<ping xmlns="urn:xmpp:ping"/>`+ `<ping xmlns="urn:xmpp:ping"/>`+
`</iq>`); `</iq>`);
done(); done();
......
...@@ -120,11 +120,11 @@ ...@@ -120,11 +120,11 @@
test_utils.openControlBox(); test_utils.openControlBox();
test_utils.createContacts(_converse, 'current'); // Create some contacts so that we can test positioning 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); const contact = _converse.roster.get(contact_jid);
let stanza = u.toStanza(` let stanza = u.toStanza(`
<presence xmlns="jabber:client" <presence xmlns="jabber:client"
to="dummy@localhost/converse.js-21770972" to="romeo@montague.lit/converse.js-21770972"
from="${contact_jid}/priority-1-resource"> from="${contact_jid}/priority-1-resource">
<priority>1</priority> <priority>1</priority>
<c xmlns="http://jabber.org/protocol/caps" hash="sha-1" ext="voice-v1 camera-v1 video-v1" <c xmlns="http://jabber.org/protocol/caps" hash="sha-1" ext="voice-v1 camera-v1 video-v1"
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
stanza = u.toStanza( stanza = u.toStanza(
'<presence xmlns="jabber:client"'+ '<presence xmlns="jabber:client"'+
' to="dummy@localhost/converse.js-21770972"'+ ' to="romeo@montague.lit/converse.js-21770972"'+
' from="'+contact_jid+'/priority-0-resource">'+ ' from="'+contact_jid+'/priority-0-resource">'+
' <status/>'+ ' <status/>'+
' <priority>0</priority>'+ ' <priority>0</priority>'+
...@@ -162,7 +162,7 @@ ...@@ -162,7 +162,7 @@
stanza = u.toStanza( stanza = u.toStanza(
'<presence xmlns="jabber:client"'+ '<presence xmlns="jabber:client"'+
' to="dummy@localhost/converse.js-21770972"'+ ' to="romeo@montague.lit/converse.js-21770972"'+
' from="'+contact_jid+'/priority-2-resource">'+ ' from="'+contact_jid+'/priority-2-resource">'+
' <priority>2</priority>'+ ' <priority>2</priority>'+
' <show>dnd</show>'+ ' <show>dnd</show>'+
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
stanza = u.toStanza( stanza = u.toStanza(
'<presence xmlns="jabber:client"'+ '<presence xmlns="jabber:client"'+
' to="dummy@localhost/converse.js-21770972"'+ ' to="romeo@montague.lit/converse.js-21770972"'+
' from="'+contact_jid+'/priority-3-resource">'+ ' from="'+contact_jid+'/priority-3-resource">'+
' <priority>3</priority>'+ ' <priority>3</priority>'+
' <show>away</show>'+ ' <show>away</show>'+
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
stanza = u.toStanza( stanza = u.toStanza(
'<presence xmlns="jabber:client"'+ '<presence xmlns="jabber:client"'+
' to="dummy@localhost/converse.js-21770972"'+ ' to="romeo@montague.lit/converse.js-21770972"'+
' from="'+contact_jid+'/older-priority-1-resource">'+ ' from="'+contact_jid+'/older-priority-1-resource">'+
' <priority>1</priority>'+ ' <priority>1</priority>'+
' <show>dnd</show>'+ ' <show>dnd</show>'+
...@@ -220,7 +220,7 @@ ...@@ -220,7 +220,7 @@
stanza = u.toStanza( stanza = u.toStanza(
'<presence xmlns="jabber:client"'+ '<presence xmlns="jabber:client"'+
' to="dummy@localhost/converse.js-21770972"'+ ' to="romeo@montague.lit/converse.js-21770972"'+
' type="unavailable"'+ ' type="unavailable"'+
' from="'+contact_jid+'/priority-3-resource">'+ ' from="'+contact_jid+'/priority-3-resource">'+
'</presence>'); '</presence>');
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
stanza = u.toStanza( stanza = u.toStanza(
'<presence xmlns="jabber:client"'+ '<presence xmlns="jabber:client"'+
' to="dummy@localhost/converse.js-21770972"'+ ' to="romeo@montague.lit/converse.js-21770972"'+
' type="unavailable"'+ ' type="unavailable"'+
' from="'+contact_jid+'/priority-2-resource">'+ ' from="'+contact_jid+'/priority-2-resource">'+
'</presence>'); '</presence>');
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
stanza = u.toStanza( stanza = u.toStanza(
'<presence xmlns="jabber:client"'+ '<presence xmlns="jabber:client"'+
' to="dummy@localhost/converse.js-21770972"'+ ' to="romeo@montague.lit/converse.js-21770972"'+
' type="unavailable"'+ ' type="unavailable"'+
' from="'+contact_jid+'/priority-1-resource">'+ ' from="'+contact_jid+'/priority-1-resource">'+
'</presence>'); '</presence>');
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
stanza = u.toStanza( stanza = u.toStanza(
'<presence xmlns="jabber:client"'+ '<presence xmlns="jabber:client"'+
' to="dummy@localhost/converse.js-21770972"'+ ' to="romeo@montague.lit/converse.js-21770972"'+
' type="unavailable"'+ ' type="unavailable"'+
' from="'+contact_jid+'/older-priority-1-resource">'+ ' from="'+contact_jid+'/older-priority-1-resource">'+
'</presence>'); '</presence>');
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
stanza = u.toStanza( stanza = u.toStanza(
'<presence xmlns="jabber:client"'+ '<presence xmlns="jabber:client"'+
' to="dummy@localhost/converse.js-21770972"'+ ' to="romeo@montague.lit/converse.js-21770972"'+
' type="unavailable"'+ ' type="unavailable"'+
' from="'+contact_jid+'/priority-0-resource">'+ ' from="'+contact_jid+'/priority-0-resource">'+
'</presence>'); '</presence>');
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
async function (done, _converse) { async function (done, _converse) {
var contact, sent_stanza, IQ_id, stanza, modal; 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); await test_utils.waitUntil(() => _converse.xmppstatus.vcard.get('fullname'), 300);
/* The process by which a user subscribes to a contact, including /* The process by which a user subscribes to a contact, including
* the interaction between roster items and subscription states. * the interaction between roster items and subscription states.
...@@ -177,7 +177,7 @@ ...@@ -177,7 +177,7 @@
expect(contact.subscribe).toHaveBeenCalled(); expect(contact.subscribe).toHaveBeenCalled();
expect(sent_stanza.toLocaleString()).toBe( // Strophe adds the xmlns attr (although not in spec) expect(sent_stanza.toLocaleString()).toBe( // Strophe adds the xmlns attr (although not in spec)
`<presence to="contact@example.org" type="subscribe" xmlns="jabber:client">`+ `<presence to="contact@example.org" type="subscribe" xmlns="jabber:client">`+
`<nick xmlns="http://jabber.org/protocol/nick">Max Mustermann</nick>`+ `<nick xmlns="http://jabber.org/protocol/nick">Romeo Montague</nick>`+
`</presence>` `</presence>`
); );
/* As a result, the user's server MUST initiate a second roster /* As a result, the user's server MUST initiate a second roster
...@@ -274,7 +274,7 @@ ...@@ -274,7 +274,7 @@
_converse.connection._dataRecv(test_utils.createRequest(stanza)); _converse.connection._dataRecv(test_utils.createRequest(stanza));
// Check that the IQ set was acknowledged. // Check that the IQ set was acknowledged.
expect(Strophe.serialize(sent_stanza)).toBe( // Strophe adds the xmlns attr (although not in spec) expect(Strophe.serialize(sent_stanza)).toBe( // Strophe adds the xmlns attr (although not in spec)
`<iq from="dummy@localhost/resource" id="${IQ_id}" type="result" xmlns="jabber:client"/>` `<iq from="romeo@montague.lit/orchard" id="${IQ_id}" type="result" xmlns="jabber:client"/>`
); );
expect(_converse.roster.updateContact).toHaveBeenCalled(); expect(_converse.roster.updateContact).toHaveBeenCalled();
...@@ -458,7 +458,7 @@ ...@@ -458,7 +458,7 @@
{ roster_groups: false }, { roster_groups: false },
async function (done, _converse) { 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.openControlBox(_converse);
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
spyOn(window, 'confirm').and.returnValue(true); spyOn(window, 'confirm').and.returnValue(true);
...@@ -499,7 +499,7 @@ ...@@ -499,7 +499,7 @@
expect(sent_IQ.toLocaleString()).toBe( expect(sent_IQ.toLocaleString()).toBe(
`<iq id="${IQ_id}" type="set" xmlns="jabber:client">`+ `<iq id="${IQ_id}" type="set" xmlns="jabber:client">`+
`<query xmlns="jabber:iq:roster">`+ `<query xmlns="jabber:iq:roster">`+
`<item jid="annegreet.gomez@localhost" subscription="remove"/>`+ `<item jid="abram@montague.lit" subscription="remove"/>`+
`</query>`+ `</query>`+
`</iq>`); `</iq>`);
......
...@@ -78,12 +78,12 @@ ...@@ -78,12 +78,12 @@
`<enable jid="push-5@client.example" node="yxs32uqsflafdk3iuqo" xmlns="urn:xmpp:push:0"/>`+ `<enable jid="push-5@client.example" node="yxs32uqsflafdk3iuqo" xmlns="urn:xmpp:push:0"/>`+
`</iq>` `</iq>`
); );
const result = u.toStanza(`<iq type="result" id="${iq.getAttribute('id')}" to="dummy@localhost" />`); const result = u.toStanza(`<iq type="result" id="${iq.getAttribute('id')}" to="romeo@montague.lit" />`);
_converse.connection._dataRecv(test_utils.createRequest(result)); _converse.connection._dataRecv(test_utils.createRequest(result));
await test_utils.waitUntil(() => _converse.session.get('push_enabled')); await test_utils.waitUntil(() => _converse.session.get('push_enabled'));
expect(_converse.session.get('push_enabled').length).toBe(1); 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'); test_utils.openAndEnterChatRoom(_converse, 'coven', 'chat.shakespeare.lit', 'oldhag');
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
).pop()); ).pop());
}).then(stanza => { }).then(stanza => {
expect(Strophe.serialize(stanza)) expect(Strophe.serialize(stanza))
.toBe(`<iq from="dummy@localhost/resource" id="${stanza.getAttribute('id')}" to="coven@chat.shakespeare.lit" `+ .toBe(`<iq from="romeo@montague.lit/orchard" id="${stanza.getAttribute('id')}" to="coven@chat.shakespeare.lit" `+
`type="get" xmlns="jabber:client">`+ `type="get" xmlns="jabber:client">`+
`<query xmlns="jabber:iq:register"/></iq>`); `<query xmlns="jabber:iq:register"/></iq>`);
view = _converse.chatboxviews.get(room_jid); view = _converse.chatboxviews.get(room_jid);
...@@ -59,7 +59,7 @@ ...@@ -59,7 +59,7 @@
).pop()); ).pop());
}).then(stanza => { }).then(stanza => {
expect(Strophe.serialize(stanza)).toBe( expect(Strophe.serialize(stanza)).toBe(
`<iq from="dummy@localhost/resource" id="${stanza.getAttribute('id')}" to="coven@chat.shakespeare.lit" type="set" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${stanza.getAttribute('id')}" to="coven@chat.shakespeare.lit" type="set" xmlns="jabber:client">`+
`<query xmlns="jabber:iq:register">`+ `<query xmlns="jabber:iq:register">`+
`<x type="submit" xmlns="jabber:x:data">`+ `<x type="submit" xmlns="jabber:x:data">`+
`<field var="FORM_TYPE"><value>http://jabber.org/protocol/muc#register</value></field>`+ `<field var="FORM_TYPE"><value>http://jabber.org/protocol/muc#register</value></field>`+
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
const features_stanza = $iq({ const features_stanza = $iq({
'from': room_jid, 'from': room_jid,
'id': stanza.getAttribute('id'), 'id': stanza.getAttribute('id'),
'to': 'dummy@localhost/desktop', 'to': 'romeo@montague.lit/desktop',
'type': 'result' 'type': 'result'
}).c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'}) }).c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'})
.c('identity', { .c('identity', {
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
).pop()); ).pop());
}).then(stanza => { }).then(stanza => {
expect(Strophe.serialize(stanza)) expect(Strophe.serialize(stanza))
.toBe(`<iq from="dummy@localhost/resource" id="${stanza.getAttribute('id')}" to="coven@chat.shakespeare.lit" `+ .toBe(`<iq from="romeo@montague.lit/orchard" id="${stanza.getAttribute('id')}" to="coven@chat.shakespeare.lit" `+
`type="get" xmlns="jabber:client">`+ `type="get" xmlns="jabber:client">`+
`<query xmlns="jabber:iq:register"/></iq>`); `<query xmlns="jabber:iq:register"/></iq>`);
view = _converse.chatboxviews.get(room_jid); view = _converse.chatboxviews.get(room_jid);
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
).pop()); ).pop());
}).then(stanza => { }).then(stanza => {
expect(Strophe.serialize(stanza)).toBe( expect(Strophe.serialize(stanza)).toBe(
`<iq from="dummy@localhost/resource" id="${stanza.getAttribute('id')}" to="coven@chat.shakespeare.lit" type="set" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${stanza.getAttribute('id')}" to="coven@chat.shakespeare.lit" type="set" xmlns="jabber:client">`+
`<query xmlns="jabber:iq:register">`+ `<query xmlns="jabber:iq:register">`+
`<x type="submit" xmlns="jabber:x:data">`+ `<x type="submit" xmlns="jabber:x:data">`+
`<field var="FORM_TYPE"><value>http://jabber.org/protocol/muc#register</value></field>`+ `<field var="FORM_TYPE"><value>http://jabber.org/protocol/muc#register</value></field>`+
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
let room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room"); let room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room");
expect(room_els.length).toBe(1); expect(room_els.length).toBe(1);
expect(room_els[0].innerText).toBe('room@conference.shakespeare.lit'); 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"); room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room");
expect(room_els.length).toBe(2); expect(room_els.length).toBe(2);
...@@ -31,11 +31,11 @@ ...@@ -31,11 +31,11 @@
view.close(); view.close();
room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room"); room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room");
expect(room_els.length).toBe(1); 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'); list = controlbox.el.querySelector('div.rooms-list-container');
test_utils.waitUntil(() => _.includes(list.classList, 'hidden')); test_utils.waitUntil(() => _.includes(list.classList, 'hidden'));
view = _converse.chatboxviews.get('lounge@localhost'); view = _converse.chatboxviews.get('lounge@montague.lit');
view.close(); view.close();
room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room"); room_els = _converse.rooms_list_view.el.querySelectorAll(".open-room");
expect(room_els.length).toBe(0); expect(room_els.length).toBe(0);
...@@ -51,18 +51,18 @@ ...@@ -51,18 +51,18 @@
{'connection': ['send']}, ['rosterGroupsFetched', 'chatBoxesFetched'], {'view_mode': 'fullscreen'}, {'connection': ['send']}, ['rosterGroupsFetched', 'chatBoxesFetched'], {'view_mode': 'fullscreen'},
async function (done, _converse) { async function (done, _converse) {
await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'localhost', 'dummy'); await test_utils.openAndEnterChatRoom(_converse, 'lounge', 'montague.lit', 'romeo');
const view = _converse.chatboxviews.get('lounge@localhost'); const view = _converse.chatboxviews.get('lounge@montague.lit');
const contact_jid = 'newguy@localhost'; const contact_jid = 'newguy@montague.lit';
let stanza = $pres({ let stanza = $pres({
to: 'dummy@localhost/resource', to: 'romeo@montague.lit/orchard',
from: 'lounge@localhost/newguy' from: 'lounge@montague.lit/newguy'
}) })
.c('x', {xmlns: Strophe.NS.MUC_USER}) .c('x', {xmlns: Strophe.NS.MUC_USER})
.c('item', { .c('item', {
'affiliation': 'none', 'affiliation': 'none',
'jid': 'newguy@localhost/_converse.js-290929789', 'jid': 'newguy@montague.lit/_converse.js-290929789',
'role': 'participant' 'role': 'participant'
}).tree(); }).tree();
_converse.connection._dataRecv(test_utils.createRequest(stanza)); _converse.connection._dataRecv(test_utils.createRequest(stanza));
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
).pop() ).pop()
); );
expect(Strophe.serialize(call.args[0])).toBe( expect(Strophe.serialize(call.args[0])).toBe(
`<iq from="dummy@localhost/resource" id="${call.args[0].getAttribute('id')}" type="get" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${call.args[0].getAttribute('id')}" type="get" xmlns="jabber:client">`+
'<pubsub xmlns="http://jabber.org/protocol/pubsub">'+ '<pubsub xmlns="http://jabber.org/protocol/pubsub">'+
'<items node="storage:bookmarks"/>'+ '<items node="storage:bookmarks"/>'+
'</pubsub>'+ '</pubsub>'+
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
.c('storage', {'xmlns': 'storage:bookmarks'}) .c('storage', {'xmlns': 'storage:bookmarks'})
.c('conference', { .c('conference', {
'name': 'Bookmarked Lounge', 'name': 'Bookmarked Lounge',
'jid': 'lounge@localhost' 'jid': 'lounge@montague.lit'
}); });
_converse.connection._dataRecv(test_utils.createRequest(stanza)); _converse.connection._dataRecv(test_utils.createRequest(stanza));
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
const features_stanza = $iq({ const features_stanza = $iq({
'from': 'coven@chat.shakespeare.lit', 'from': 'coven@chat.shakespeare.lit',
'id': IQ_id, 'id': IQ_id,
'to': 'dummy@localhost/desktop', 'to': 'romeo@montague.lit/desktop',
'type': 'result' 'type': 'result'
}) })
.c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'}) .c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'})
...@@ -222,13 +222,13 @@ ...@@ -222,13 +222,13 @@
'Not moderated - Participants entering this groupchat can write right away' 'Not moderated - Participants entering this groupchat can write right away'
); );
presence = $pres({ presence = $pres({
to: 'dummy@localhost/_converse.js-29092160', to: 'romeo@montague.lit/_converse.js-29092160',
from: 'coven@chat.shakespeare.lit/newguy' from: 'coven@chat.shakespeare.lit/newguy'
}) })
.c('x', {xmlns: Strophe.NS.MUC_USER}) .c('x', {xmlns: Strophe.NS.MUC_USER})
.c('item', { .c('item', {
'affiliation': 'none', 'affiliation': 'none',
'jid': 'newguy@localhost/_converse.js-290929789', 'jid': 'newguy@montague.lit/_converse.js-290929789',
'role': 'participant' 'role': 'participant'
}); });
_converse.connection._dataRecv(test_utils.createRequest(presence)); _converse.connection._dataRecv(test_utils.createRequest(presence));
...@@ -282,13 +282,13 @@ ...@@ -282,13 +282,13 @@
await test_utils.openAndEnterChatRoom(_converse, 'kitchen', 'conference.shakespeare.lit', 'romeo'); await test_utils.openAndEnterChatRoom(_converse, 'kitchen', 'conference.shakespeare.lit', 'romeo');
const view = _converse.chatboxviews.get(room_jid); const view = _converse.chatboxviews.get(room_jid);
view.model.set({'minimized': true}); 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]; const nick = mock.chatroom_names[0];
await view.model.onMessage( await view.model.onMessage(
$msg({ $msg({
from: room_jid+'/'+nick, from: room_jid+'/'+nick,
id: (new Date()).getTime(), id: (new Date()).getTime(),
to: 'dummy@localhost', to: 'romeo@montague.lit',
type: 'groupchat' type: 'groupchat'
}).c('body').t('foo').tree()); }).c('body').t('foo').tree());
...@@ -301,7 +301,7 @@ ...@@ -301,7 +301,7 @@
$msg({ $msg({
from: room_jid+'/'+nick, from: room_jid+'/'+nick,
id: (new Date()).getTime(), id: (new Date()).getTime(),
to: 'dummy@localhost', to: 'romeo@montague.lit',
type: 'groupchat' type: 'groupchat'
}).c('body').t('romeo: Your attention is required').tree() }).c('body').t('romeo: Your attention is required').tree()
); );
...@@ -313,7 +313,7 @@ ...@@ -313,7 +313,7 @@
$msg({ $msg({
from: room_jid+'/'+nick, from: room_jid+'/'+nick,
id: (new Date()).getTime(), id: (new Date()).getTime(),
to: 'dummy@localhost', to: 'romeo@montague.lit',
type: 'groupchat' type: 'groupchat'
}).c('body').t('romeo: and another thing...').tree() }).c('body').t('romeo: and another thing...').tree()
); );
......
This diff is collapsed.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
const view = _converse.chatboxviews.get('controlbox'); const view = _converse.chatboxviews.get('controlbox');
spyOn(view, 'renderControlBoxPane').and.callThrough(); spyOn(view, 'renderControlBoxPane').and.callThrough();
_converse.api.user.login('dummy@localhost', 'secret'); _converse.api.user.login('romeo@montague.lit', 'secret');
const sent_stanzas = _converse.connection.sent_stanzas; const sent_stanzas = _converse.connection.sent_stanzas;
let stanza = await test_utils.waitUntil(() => let stanza = await test_utils.waitUntil(() =>
sent_stanzas.filter(s => (s.tagName === 'enable')).pop()); sent_stanzas.filter(s => (s.tagName === 'enable')).pop());
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
let iq = IQ_stanzas.pop(); let iq = IQ_stanzas.pop();
expect(Strophe.serialize(iq)).toBe( expect(Strophe.serialize(iq)).toBe(
`<iq from="dummy@localhost/resource" id="${iq.getAttribute('id')}" to="dummy@localhost" type="get" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${iq.getAttribute('id')}" to="romeo@montague.lit" type="get" xmlns="jabber:client">`+
`<query xmlns="http://jabber.org/protocol/disco#info"/></iq>`); `<query xmlns="http://jabber.org/protocol/disco#info"/></iq>`);
iq = IQ_stanzas.pop(); iq = IQ_stanzas.pop();
...@@ -50,12 +50,12 @@ ...@@ -50,12 +50,12 @@
iq = IQ_stanzas.pop(); iq = IQ_stanzas.pop();
expect(Strophe.serialize(iq)).toBe( expect(Strophe.serialize(iq)).toBe(
`<iq from="dummy@localhost/resource" id="${iq.getAttribute('id')}" to="localhost" type="get" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${iq.getAttribute('id')}" to="montague.lit" type="get" xmlns="jabber:client">`+
`<query xmlns="http://jabber.org/protocol/disco#info"/></iq>`); `<query xmlns="http://jabber.org/protocol/disco#info"/></iq>`);
const disco_iq = IQ_stanzas.pop(); const disco_iq = IQ_stanzas.pop();
expect(Strophe.serialize(disco_iq)).toBe( expect(Strophe.serialize(disco_iq)).toBe(
`<iq from="dummy@localhost" id="${disco_iq.getAttribute('id')}" to="dummy@localhost" type="get" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit" id="${disco_iq.getAttribute('id')}" to="romeo@montague.lit" type="get" xmlns="jabber:client">`+
`<pubsub xmlns="http://jabber.org/protocol/pubsub"><items node="eu.siacs.conversations.axolotl.devicelist"/></pubsub></iq>`); `<pubsub xmlns="http://jabber.org/protocol/pubsub"><items node="eu.siacs.conversations.axolotl.devicelist"/></pubsub></iq>`);
expect(sent_stanzas.filter(s => (s.nodeName === 'r')).length).toBe(2); expect(sent_stanzas.filter(s => (s.nodeName === 'r')).length).toBe(2);
...@@ -74,8 +74,8 @@ ...@@ -74,8 +74,8 @@
const disco_result = $iq({ const disco_result = $iq({
'type': 'result', 'type': 'result',
'from': 'localhost', 'from': 'montague.lit',
'to': 'dummy@localhost/resource', 'to': 'romeo@montague.lit/orchard',
'id': disco_iq.getAttribute('id'), 'id': disco_iq.getAttribute('id'),
}).c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'}) }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'})
.c('identity', { .c('identity', {
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
// Test that unacked stanzas get resent out // Test that unacked stanzas get resent out
iq = IQ_stanzas.pop(); iq = IQ_stanzas.pop();
expect(Strophe.serialize(iq)).toBe( expect(Strophe.serialize(iq)).toBe(
`<iq from="dummy@localhost/resource" id="${iq.getAttribute('id')}" to="dummy@localhost" type="get" xmlns="jabber:client">`+ `<iq from="romeo@montague.lit/orchard" id="${iq.getAttribute('id')}" to="romeo@montague.lit" type="get" xmlns="jabber:client">`+
`<query xmlns="http://jabber.org/protocol/disco#info"/></iq>`); `<query xmlns="http://jabber.org/protocol/disco#info"/></iq>`);
iq = IQ_stanzas.pop(); iq = IQ_stanzas.pop();
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
async (done, _converse) => { async (done, _converse) => {
await test_utils.waitForRoster(_converse, 'current'); 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';
/* <message to='romeo@montague.net/orchard' from='juliet@capulet.net/balcony' id='spoiler2'> /* <message to='romeo@montague.net/orchard' from='juliet@capulet.net/balcony' id='spoiler2'>
* <body>And at the end of the story, both of them die! It is so tragic!</body> * <body>And at the end of the story, both of them die! It is so tragic!</body>
...@@ -38,8 +38,8 @@ ...@@ -38,8 +38,8 @@
await test_utils.waitUntil(() => _converse.api.chats.get().length === 2); await test_utils.waitUntil(() => _converse.api.chats.get().length === 2);
const view = _converse.chatboxviews.get(sender_jid); const view = _converse.chatboxviews.get(sender_jid);
await test_utils.waitUntil(() => view.model.vcard.get('fullname') === 'Max Frankfurter') await test_utils.waitUntil(() => view.model.vcard.get('fullname') === 'Mercutio')
expect(view.el.querySelector('.chat-msg__author').textContent.trim()).toBe('Max Frankfurter'); expect(view.el.querySelector('.chat-msg__author').textContent.trim()).toBe('Mercutio');
const message_content = view.el.querySelector('.chat-msg__text'); const message_content = view.el.querySelector('.chat-msg__text');
expect(message_content.textContent).toBe(spoiler); expect(message_content.textContent).toBe(spoiler);
const spoiler_hint_el = view.el.querySelector('.spoiler-hint'); const spoiler_hint_el = view.el.querySelector('.spoiler-hint');
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
async (done, _converse) => { async (done, _converse) => {
await test_utils.waitForRoster(_converse, 'current'); 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';
/* <message to='romeo@montague.net/orchard' from='juliet@capulet.net/balcony' id='spoiler2'> /* <message to='romeo@montague.net/orchard' from='juliet@capulet.net/balcony' id='spoiler2'>
* <body>And at the end of the story, both of them die! It is so tragic!</body> * <body>And at the end of the story, both of them die! It is so tragic!</body>
* <spoiler xmlns='urn:xmpp:spoiler:0'>Love story end</spoiler> * <spoiler xmlns='urn:xmpp:spoiler:0'>Love story end</spoiler>
...@@ -72,8 +72,8 @@ ...@@ -72,8 +72,8 @@
await _converse.chatboxes.onMessage(msg); await _converse.chatboxes.onMessage(msg);
await test_utils.waitUntil(() => _converse.api.chats.get().length === 2); await test_utils.waitUntil(() => _converse.api.chats.get().length === 2);
const view = _converse.chatboxviews.get(sender_jid); const view = _converse.chatboxviews.get(sender_jid);
await test_utils.waitUntil(() => view.model.vcard.get('fullname') === 'Max Frankfurter') await test_utils.waitUntil(() => view.model.vcard.get('fullname') === 'Mercutio')
expect(_.includes(view.el.querySelector('.chat-msg__author').textContent, 'Max Frankfurter')).toBeTruthy(); expect(_.includes(view.el.querySelector('.chat-msg__author').textContent, 'Mercutio')).toBeTruthy();
const message_content = view.el.querySelector('.chat-msg__text'); const message_content = view.el.querySelector('.chat-msg__text');
expect(message_content.textContent).toBe(spoiler); expect(message_content.textContent).toBe(spoiler);
const spoiler_hint_el = view.el.querySelector('.spoiler-hint'); const spoiler_hint_el = view.el.querySelector('.spoiler-hint');
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
await test_utils.waitForRoster(_converse, 'current', 1); await test_utils.waitForRoster(_converse, 'current', 1);
test_utils.openControlBox(); 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 // XXX: We need to send a presence from the contact, so that we
// have a resource, that resource is then queried to see // have a resource, that resource is then queried to see
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
// the spoiler button will appear. // the spoiler button will appear.
const presence = $pres({ const presence = $pres({
'from': contact_jid+'/phone', 'from': contact_jid+'/phone',
'to': 'dummy@localhost' 'to': 'romeo@montague.lit'
}); });
_converse.connection._dataRecv(test_utils.createRequest(presence)); _converse.connection._dataRecv(test_utils.createRequest(presence));
await test_utils.openChatBoxFor(_converse, contact_jid); await test_utils.openChatBoxFor(_converse, contact_jid);
...@@ -119,8 +119,8 @@ ...@@ -119,8 +119,8 @@
/* Test the XML stanza /* Test the XML stanza
* *
* <message from="dummy@localhost/resource" * <message from="romeo@montague.lit/orchard"
* to="max.frankfurter@localhost" * to="max.frankfurter@montague.lit"
* type="chat" * type="chat"
* id="4547c38b-d98b-45a5-8f44-b4004dbc335e" * id="4547c38b-d98b-45a5-8f44-b4004dbc335e"
* xmlns="jabber:client"> * xmlns="jabber:client">
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
expect(body_el.textContent).toBe('This is the spoiler'); expect(body_el.textContent).toBe('This is the spoiler');
/* Test the HTML spoiler message */ /* 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'); const spoiler_msg_el = view.el.querySelector('.chat-msg__text.spoiler');
expect(spoiler_msg_el.textContent).toBe('This is the spoiler'); expect(spoiler_msg_el.textContent).toBe('This is the spoiler');
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
await test_utils.waitForRoster(_converse, 'current', 1); await test_utils.waitForRoster(_converse, 'current', 1);
test_utils.openControlBox(); 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 // XXX: We need to send a presence from the contact, so that we
// have a resource, that resource is then queried to see // have a resource, that resource is then queried to see
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
// the spoiler button will appear. // the spoiler button will appear.
const presence = $pres({ const presence = $pres({
'from': contact_jid+'/phone', 'from': contact_jid+'/phone',
'to': 'dummy@localhost' 'to': 'romeo@montague.lit'
}); });
_converse.connection._dataRecv(test_utils.createRequest(presence)); _converse.connection._dataRecv(test_utils.createRequest(presence));
await test_utils.openChatBoxFor(_converse, contact_jid); await test_utils.openChatBoxFor(_converse, contact_jid);
...@@ -196,8 +196,8 @@ ...@@ -196,8 +196,8 @@
/* Test the XML stanza /* Test the XML stanza
* *
* <message from="dummy@localhost/resource" * <message from="romeo@montague.lit/orchard"
* to="max.frankfurter@localhost" * to="max.frankfurter@montague.lit"
* type="chat" * type="chat"
* id="4547c38b-d98b-45a5-8f44-b4004dbc335e" * id="4547c38b-d98b-45a5-8f44-b4004dbc335e"
* xmlns="jabber:client"> * xmlns="jabber:client">
...@@ -216,7 +216,7 @@ ...@@ -216,7 +216,7 @@
expect(body_el.textContent).toBe('This is the spoiler'); expect(body_el.textContent).toBe('This is the spoiler');
/* Test the HTML spoiler message */ /* 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'); const spoiler_msg_el = view.el.querySelector('.chat-msg__text.spoiler');
expect(spoiler_msg_el.textContent).toBe('This is the spoiler'); expect(spoiler_msg_el.textContent).toBe('This is the spoiler');
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
_converse.allow_non_roster_messaging = true; _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); spyOn(_converse, 'areDesktopNotificationsEnabled').and.returnValue(true);
_.each(transcripts, function (transcript) { _.each(transcripts, function (transcript) {
var text = transcript(); var text = transcript();
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
_converse.api.trigger('rosterContactsFetched'); _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); test_utils.openChatBoxFor(_converse, contact_jid);
await test_utils.waitUntil(() => _converse.chatboxes.length > 1); await test_utils.waitUntil(() => _converse.chatboxes.length > 1);
const view = _converse.chatboxviews.get(contact_jid); const view = _converse.chatboxviews.get(contact_jid);
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
_converse.api.trigger('rosterContactsFetched'); _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) await test_utils.openChatBoxFor(_converse, contact_jid)
const view = _converse.chatboxviews.get(contact_jid); const view = _converse.chatboxviews.get(contact_jid);
let show_modal_button = view.el.querySelector('.show-user-details-modal'); let show_modal_button = view.el.querySelector('.show-user-details-modal');
...@@ -75,7 +75,7 @@ ...@@ -75,7 +75,7 @@
const header = document.querySelector('.alert-danger .modal-title'); const header = document.querySelector('.alert-danger .modal-title');
expect(header.textContent).toBe("Error"); expect(header.textContent).toBe("Error");
expect(u.ancestor(header, '.modal-content').querySelector('.modal-body p').textContent.trim()) 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(); document.querySelector('.alert-danger button.close').click();
show_modal_button = view.el.querySelector('.show-user-details-modal'); show_modal_button = view.el.querySelector('.show-user-details-modal');
show_modal_button.click(); show_modal_button.click();
......
...@@ -1524,7 +1524,7 @@ _converse.api = { ...@@ -1524,7 +1524,7 @@ _converse.api = {
* @example * @example
* converse.plugins.add('myplugin', { * converse.plugins.add('myplugin', {
* initialize: function () { * initialize: function () {
* this._converse.api.user.login('dummy@example.com', 'secret'); * this._converse.api.user.login('romeo@montague.lit', 'secret');
* } * }
* }); * });
*/ */
......
...@@ -71,15 +71,15 @@ ...@@ -71,15 +71,15 @@
// Names from http://www.fakenamegenerator.com/ // Names from http://www.fakenamegenerator.com/
mock.req_names = [ mock.req_names = [
'Louw Spekman', 'Mohamad Stet', 'Dominik Beyer' 'Escalus, Prince of Verona', 'The Nurse', 'Paris'
]; ];
mock.pend_names = [ mock.pend_names = [
'Suleyman van Beusichem', 'Nanja van Yperen', 'Nicole Diederich' 'Lord Capulet', 'Lady Capulet', 'Servant'
]; ];
mock.cur_names = [ mock.cur_names = [
'Max Frankfurter', 'Candice van der Knijff', 'Irini Vlastuin', 'Rinse Sommer', 'Annegreet Gomez', 'Mercutio', 'Juliet Capulet', 'Lady Montague', 'Lord Montague', 'Friar Laurence',
'Robin Schook', 'Marcel Eberhardt', 'Simone Brauer', 'Asmaa Haakman', 'Felix Amsel', 'Tybalt', 'Lady Capulet', 'Benviolo', 'Balthasar',
'Lena Grunewald', 'Laura Grunewald', 'Mandy Seiler', 'Sven Bosch', 'Nuriye Cuypers' 'Peter', 'Abram', 'Sampson', 'Gregory', 'Potpan', 'Friar John'
]; ];
mock.num_contacts = mock.req_names.length + mock.pend_names.length + mock.cur_names.length; mock.num_contacts = mock.req_names.length + mock.pend_names.length + mock.cur_names.length;
...@@ -154,7 +154,7 @@ ...@@ -154,7 +154,7 @@
c._proto._connect = function () { c._proto._connect = function () {
c.connected = true; c.connected = true;
c.mock = true; c.mock = true;
c.jid = 'dummy@localhost/resource'; c.jid = 'romeo@montague.lit/orchard';
c._changeConnectStatus(Strophe.Status.BINDREQUIRED); c._changeConnectStatus(Strophe.Status.BINDREQUIRED);
}; };
...@@ -190,7 +190,7 @@ ...@@ -190,7 +190,7 @@
'i18n': 'en', 'i18n': 'en',
'auto_subscribe': false, 'auto_subscribe': false,
'play_sounds': false, 'play_sounds': false,
'bosh_service_url': 'localhost', 'bosh_service_url': 'montague.lit/http-bind',
'connection': connection, 'connection': connection,
'animate': false, 'animate': false,
'use_emojione': false, 'use_emojione': false,
...@@ -214,9 +214,9 @@ ...@@ -214,9 +214,9 @@
jid = model.get('jid') || model.get('muc_jid'); jid = model.get('jid') || model.get('muc_jid');
} }
let fullname; let fullname;
if (!jid || jid == 'dummy@localhost') { if (!jid || jid == 'romeo@montague.lit') {
jid = 'dummy@localhost'; jid = 'romeo@montague.lit';
fullname = 'Max Mustermann' ; fullname = 'Romeo Montague' ;
} else { } else {
const name = jid.split('@')[0].replace(/\./g, ' ').split(' '); const name = jid.split('@')[0].replace(/\./g, ' ').split(' ');
const last = name.length-1; const last = name.length-1;
...@@ -238,7 +238,7 @@ ...@@ -238,7 +238,7 @@
}).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL)); }).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
}; };
if (_.get(settings, 'auto_login') !== false) { 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'); await _converse.api.waitUntil('afterResourceBinding');
} }
window.converse_disable_effects = true; window.converse_disable_effects = true;
......
...@@ -34,11 +34,11 @@ var specs = [ ...@@ -34,11 +34,11 @@ var specs = [
"jasmine", "jasmine",
//"spec/transcripts", //"spec/transcripts",
"spec/spoilers", "spec/spoilers",
"spec/roomslist",
"spec/profiling", "spec/profiling",
"spec/utils", "spec/utils",
"spec/converse", "spec/converse",
"spec/bookmarks", "spec/bookmarks",
"spec/roomslist",
"spec/headline", "spec/headline",
"spec/disco", "spec/disco",
"spec/protocol", "spec/protocol",
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
const stanza = $iq({ const stanza = $iq({
'type': 'result', 'type': 'result',
'from': entity_jid, 'from': entity_jid,
'to': 'dummy@localhost/resource', 'to': 'romeo@montague.lit/orchard',
'id': iq.getAttribute('id'), 'id': iq.getAttribute('id'),
}).c('query', {'xmlns': 'http://jabber.org/protocol/disco#'+type}); }).c('query', {'xmlns': 'http://jabber.org/protocol/disco#'+type});
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
utils.openChatBoxes = function (converse, amount) { utils.openChatBoxes = function (converse, amount) {
var i = 0, jid, views = []; var i = 0, jid, views = [];
for (i; i<amount; i++) { for (i; i<amount; i++) {
jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost'; jid = mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@montague.lit';
views[i] = converse.roster.get(jid).trigger("open"); views[i] = converse.roster.get(jid).trigger("open");
} }
return views; return views;
...@@ -130,7 +130,7 @@ ...@@ -130,7 +130,7 @@
const features_stanza = $iq({ const features_stanza = $iq({
'from': room_jid, 'from': room_jid,
'id': stanza.getAttribute('id'), 'id': stanza.getAttribute('id'),
'to': 'dummy@localhost/desktop', 'to': 'romeo@montague.lit/desktop',
'type': 'result' 'type': 'result'
}).c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'}) }).c('query', { 'xmlns': 'http://jabber.org/protocol/disco#info'})
.c('identity', { .c('identity', {
...@@ -254,11 +254,11 @@ ...@@ -254,11 +254,11 @@
length = names.length; length = names.length;
} }
for (var i=0; i<length; i++) { for (var i=0; i<length; i++) {
jid = names[i].replace(/ /g,'.').toLowerCase() + '@localhost'; jid = names[i].replace(/ /g,'.').toLowerCase() + '@montague.lit';
if (!converse.roster.get(jid)) { if (!converse.roster.get(jid)) {
converse.roster.create({ converse.roster.create({
'ask': ask, 'ask': ask,
'fullname': names[i], 'name': names[i],
'jid': jid, 'jid': jid,
'requesting': requesting, 'requesting': requesting,
'subscription': subscription 'subscription': subscription
...@@ -285,7 +285,7 @@ ...@@ -285,7 +285,7 @@
if (type === 'pending' || type === 'all') { if (type === 'pending' || type === 'all') {
mock.pend_names.slice(0, length).map(name => mock.pend_names.slice(0, length).map(name =>
result.c('item', { result.c('item', {
jid: name.replace(/ /g,'.').toLowerCase() + '@localhost', jid: name.replace(/ /g,'.').toLowerCase() + '@montague.lit',
name: include_nick ? name : undefined, name: include_nick ? name : undefined,
subscription: 'to' subscription: 'to'
}).up() }).up()
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
} else if (type === 'current' || type === 'all') { } else if (type === 'current' || type === 'all') {
mock.cur_names.slice(0, length).map(name => mock.cur_names.slice(0, length).map(name =>
result.c('item', { result.c('item', {
jid: name.replace(/ /g,'.').toLowerCase() + '@localhost', jid: name.replace(/ /g,'.').toLowerCase() + '@montague.lit',
name: include_nick ? name : undefined, name: include_nick ? name : undefined,
subscription: 'both' subscription: 'both'
}).up() }).up()
...@@ -311,11 +311,11 @@ ...@@ -311,11 +311,11 @@
j = i; j = i;
for (i=j; i<j+mock.groups[name]; i++) { for (i=j; i<j+mock.groups[name]; i++) {
converse.roster.create({ converse.roster.create({
jid: mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost', 'jid': mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@montague.lit',
subscription: 'both', 'subscription': 'both',
ask: null, 'ask': null,
groups: name === 'ungrouped'? [] : [name], 'groups': name === 'ungrouped'? [] : [name],
fullname: mock.cur_names[i] 'name': mock.cur_names[i]
}); });
} }
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment