2015-07-21 23:24:05 +02:00
|
|
|
(function (root, factory) {
|
|
|
|
define([
|
|
|
|
"jquery",
|
2017-02-14 15:08:39 +01:00
|
|
|
"converse-core",
|
2015-07-21 23:24:05 +02:00
|
|
|
"mock",
|
2016-11-30 13:18:58 +01:00
|
|
|
"test_utils"], factory);
|
2016-12-20 10:30:20 +01:00
|
|
|
} (this, function ($, converse, mock, test_utils) {
|
2015-07-21 23:24:05 +02:00
|
|
|
"use strict";
|
2016-12-20 10:30:20 +01:00
|
|
|
var Strophe = converse.env.Strophe;
|
2015-07-21 23:24:05 +02:00
|
|
|
|
2016-11-03 11:01:09 +01:00
|
|
|
describe("Service Discovery", function () {
|
2016-12-19 10:32:48 +01:00
|
|
|
describe("Whenever converse.js discovers a new server feature", function () {
|
2016-12-20 10:30:20 +01:00
|
|
|
it("emits the serviceDiscovered event", mock.initConverse(function (_converse) {
|
|
|
|
spyOn(_converse, 'emit');
|
|
|
|
_converse.features.create({'var': Strophe.NS.MAM});
|
|
|
|
expect(_converse.emit).toHaveBeenCalled();
|
|
|
|
expect(_converse.emit.argsForCall[0][1].get('var')).toBe(Strophe.NS.MAM);
|
2016-11-03 11:01:09 +01:00
|
|
|
}));
|
|
|
|
});
|
|
|
|
});
|
2015-07-21 23:24:05 +02:00
|
|
|
}));
|