Commit 76a18bae authored by JC Brand's avatar JC Brand

Finish the test which checks that contacts can appear in more than one group

parent 2b927f21
...@@ -193,16 +193,24 @@ ...@@ -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));
......
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