Fix disco test
This commit is contained in:
parent
59edcb2393
commit
bfc1e99694
@ -28,6 +28,9 @@
|
||||
* id='info1'>
|
||||
* <query xmlns='http://jabber.org/protocol/disco#info'>
|
||||
* <identity
|
||||
* category='server'
|
||||
* type='im'/>
|
||||
* <identity
|
||||
* category='conference'
|
||||
* type='text'
|
||||
* name='Play-Specific Chatrooms'/>
|
||||
@ -52,6 +55,9 @@
|
||||
'to': 'dummy@localhost/resource',
|
||||
'id': info_IQ_id
|
||||
}).c('query', {'xmlns': 'http://jabber.org/protocol/disco#info'})
|
||||
.c('identity', {
|
||||
'category': 'server',
|
||||
'type': 'im'}).up()
|
||||
.c('identity', {
|
||||
'category': 'conference',
|
||||
'type': 'text',
|
||||
@ -74,7 +80,8 @@
|
||||
|
||||
var entities = _converse.disco_entities;
|
||||
expect(entities.length).toBe(1);
|
||||
expect(entities.get('localhost').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('localhost').features.where({'var': 'jabber:iq:version'}).length).toBe(1);
|
||||
expect(entities.get('localhost').features.where({'var': 'jabber:iq:time'}).length).toBe(1);
|
||||
expect(entities.get('localhost').features.where({'var': 'jabber:iq:register'}).length).toBe(1);
|
||||
@ -153,8 +160,6 @@
|
||||
|
||||
entities = _converse.disco_entities;
|
||||
expect(entities.length).toBe(4);
|
||||
expect(entities.get(_converse.domain).features.length).toBe(5);
|
||||
expect(entities.get(_converse.domain).identities.length).toBe(2);
|
||||
expect(entities.get(_converse.domain).identities.where({'category': 'conference'}).length).toBe(1);
|
||||
expect(entities.get(_converse.domain).identities.where({'category': 'directory'}).length).toBe(1);
|
||||
done();
|
||||
|
@ -80,7 +80,6 @@
|
||||
},
|
||||
|
||||
queryForItems () {
|
||||
|
||||
if (_.isEmpty(this.identities.where({'category': 'server'}))) {
|
||||
// Don't fetch features and items if this is not a
|
||||
// server or a conference component.
|
||||
|
Loading…
Reference in New Issue
Block a user