Commit fa0e7aef authored by JC Brand's avatar JC Brand

Updated so that own device is properly created and published

Based on live testing. Updated tests accordingly.
parent a422f078
This diff is collapsed.
...@@ -621,10 +621,10 @@ ...@@ -621,10 +621,10 @@
expect(view.model.get('chat_state')).toBe('inactive'); expect(view.model.get('chat_state')).toBe('inactive');
spyOn(_converse.connection, 'send'); spyOn(_converse.connection, 'send');
view.model.maximize(); view.model.maximize();
return test_utils.waitUntil(() => view.model.get('chat_state') === 'active', 700); return test_utils.waitUntil(() => view.model.get('chat_state') === 'active', 1000);
}).then(() => { }).then(() => {
expect(_converse.connection.send).toHaveBeenCalled(); expect(_converse.connection.send).toHaveBeenCalled();
var calls = _.filter(_converse.connection.send.calls.all(), function (call) { const calls = _.filter(_converse.connection.send.calls.all(), function (call) {
return call.args[0] instanceof Strophe.Builder; return call.args[0] instanceof Strophe.Builder;
}); });
expect(calls.length).toBe(1); expect(calls.length).toBe(1);
...@@ -635,7 +635,7 @@ ...@@ -635,7 +635,7 @@
expect($stanza.children().get(1).tagName).toBe('no-store'); expect($stanza.children().get(1).tagName).toBe('no-store');
expect($stanza.children().get(2).tagName).toBe('no-permanent-store'); expect($stanza.children().get(2).tagName).toBe('no-permanent-store');
done(); done();
}); }).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL))
})); }));
}); });
......
This diff is collapsed.
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
"<presence xmlns='jabber:client'>"+ "<presence xmlns='jabber:client'>"+
"<status>Hello world</status>"+ "<status>Hello world</status>"+
"<priority>0</priority>"+ "<priority>0</priority>"+
"<c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://conversejs.org' ver='nE765l4CRVrSUEIPAdtgCw4+5cc='/>"+ "<c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://conversejs.org' ver='ggltNSI5YG/7dFKB57Bk2dRYRU0='/>"+
"</presence>" "</presence>"
); );
_converse.priority = 2; _converse.priority = 2;
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
"<show>away</show>"+ "<show>away</show>"+
"<status>Going jogging</status>"+ "<status>Going jogging</status>"+
"<priority>2</priority>"+ "<priority>2</priority>"+
"<c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://conversejs.org' ver='nE765l4CRVrSUEIPAdtgCw4+5cc='/>"+ "<c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://conversejs.org' ver='ggltNSI5YG/7dFKB57Bk2dRYRU0='/>"+
"</presence>" "</presence>"
); );
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
"<show>dnd</show>"+ "<show>dnd</show>"+
"<status>Doing taxes</status>"+ "<status>Doing taxes</status>"+
"<priority>0</priority>"+ "<priority>0</priority>"+
"<c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://conversejs.org' ver='nE765l4CRVrSUEIPAdtgCw4+5cc='/>"+ "<c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://conversejs.org' ver='ggltNSI5YG/7dFKB57Bk2dRYRU0='/>"+
"</presence>" "</presence>"
); );
})); }));
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
.toBe("<presence xmlns='jabber:client'>"+ .toBe("<presence xmlns='jabber:client'>"+
"<status>My custom status</status>"+ "<status>My custom status</status>"+
"<priority>0</priority>"+ "<priority>0</priority>"+
"<c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://conversejs.org' ver='nE765l4CRVrSUEIPAdtgCw4+5cc='/>"+ "<c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://conversejs.org' ver='ggltNSI5YG/7dFKB57Bk2dRYRU0='/>"+
"</presence>") "</presence>")
return test_utils.waitUntil(function () { return test_utils.waitUntil(function () {
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
modal.el.querySelector('[type="submit"]').click(); modal.el.querySelector('[type="submit"]').click();
expect(_converse.connection.send.calls.mostRecent().args[0].toLocaleString()) expect(_converse.connection.send.calls.mostRecent().args[0].toLocaleString())
.toBe("<presence xmlns='jabber:client'><show>dnd</show><status>My custom status</status><priority>0</priority>"+ .toBe("<presence xmlns='jabber:client'><show>dnd</show><status>My custom status</status><priority>0</priority>"+
"<c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://conversejs.org' ver='nE765l4CRVrSUEIPAdtgCw4+5cc='/>"+ "<c xmlns='http://jabber.org/protocol/caps' hash='sha-1' node='https://conversejs.org' ver='ggltNSI5YG/7dFKB57Bk2dRYRU0='/>"+
"</presence>") "</presence>")
done(); done();
}); });
......
This diff is collapsed.
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
utils.openChatBoxFor = function (_converse, jid) { utils.openChatBoxFor = function (_converse, jid) {
_converse.roster.get(jid).trigger("open"); _converse.roster.get(jid).trigger("open");
return utils.waitUntil(() => _converse.chatboxviews.get(jid)); return utils.waitUntil(() => _converse.chatboxviews.get(jid), 1000);
}; };
utils.openChatRoomViaModal = function (_converse, jid, nick='') { utils.openChatRoomViaModal = function (_converse, jid, nick='') {
......
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