Commit bfc1e996 authored by JC Brand's avatar JC Brand

Fix disco test

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