Hogfather message round trip.

This commit is contained in:
Ian Gulliver
2016-01-08 15:39:13 -08:00
parent 3a4614f977
commit 6c51f14723

View File

@@ -967,3 +967,22 @@ QUnit.asyncTest('PublicChat.create', function(assert) {
QUnit.start(); QUnit.start();
}); });
}); });
QUnit.asyncTest('PublicChat message round trip', function(assert) {
assert.expect(2);
var message = randstring();
var cosmo = new Cosmopolite(null, randstring());
hogfather.PublicChat.create(cosmo).then(function(chat) {
chat.addEventListener('message', function(e) {
assert.equal(e.detail.message, message);
chat.shutdown();
cosmo.shutdown();
QUnit.start();
});
chat.sendMessage(message).then(function(msg) {
assert.equal(msg.message.message, message);
});
});
});