Finish the test which checks that contacts can appear in more than one group
This commit is contained in:
parent
2b927f21be
commit
76a18bae0d
|
@ -193,16 +193,24 @@
|
||||||
spyOn(this.rosterview, 'updateCount').andCallThrough();
|
spyOn(this.rosterview, 'updateCount').andCallThrough();
|
||||||
converse.roster_groups = true;
|
converse.roster_groups = true;
|
||||||
converse.rosterview.render();
|
converse.rosterview.render();
|
||||||
|
var groups = ['colleagues', 'friends'];
|
||||||
for (i=0; i<mock.cur_names.length; i++) {
|
for (i=0; i<mock.cur_names.length; i++) {
|
||||||
this.roster.create({
|
this.roster.create({
|
||||||
jid: mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost',
|
jid: mock.cur_names[i].replace(/ /g,'.').toLowerCase() + '@localhost',
|
||||||
subscription: 'both',
|
subscription: 'both',
|
||||||
ask: null,
|
ask: null,
|
||||||
groups: ['colleagues', 'friends'],
|
groups: groups,
|
||||||
fullname: mock.cur_names[i],
|
fullname: mock.cur_names[i],
|
||||||
is_last: i===(mock.cur_names.length-1)
|
is_last: i===(mock.cur_names.length-1)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// Check that usernames appear alphabetically per group
|
||||||
|
_.each(groups, $.proxy(function (name) {
|
||||||
|
var $contacts = this.rosterview.$('dt.roster-group[data-group="'+name+'"]').nextUntil('dt', 'dd');
|
||||||
|
var names = $.map($contacts, function (o) { return $(o).text().trim(); });
|
||||||
|
expect(names).toEqual(_.clone(names).sort());
|
||||||
|
expect(names.length).toEqual(mock.cur_names.length);
|
||||||
|
}, converse));
|
||||||
}, converse));
|
}, converse));
|
||||||
}, converse));
|
}, converse));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user