Fix disco test

This commit is contained in:
JC Brand 2017-07-21 20:00:57 +02:00
parent 59edcb2393
commit bfc1e99694
2 changed files with 8 additions and 4 deletions

View File

@ -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();

View File

@ -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.