"is_last" property no longer used.

This commit is contained in:
JC Brand 2014-08-04 18:00:30 +02:00
parent 539bd2db10
commit 9a3104cb21
2 changed files with 11 additions and 23 deletions

View File

@ -163,8 +163,7 @@
subscription: 'both', subscription: 'both',
ask: null, ask: null,
groups: name === 'ungrouped'? [] : [name], groups: name === 'ungrouped'? [] : [name],
fullname: mock.cur_names[i], fullname: mock.cur_names[i]
is_last: i===(mock.cur_names.length-1)
}); });
} }
}, converse)); }, converse));
@ -201,8 +200,7 @@
subscription: 'both', subscription: 'both',
ask: null, ask: null,
groups: groups, groups: groups,
fullname: mock.cur_names[i], fullname: mock.cur_names[i]
is_last: i===(mock.cur_names.length-1)
}); });
} }
// Check that usernames appear alphabetically per group // Check that usernames appear alphabetically per group
@ -229,8 +227,7 @@
subscription: 'both', subscription: 'both',
ask: null, ask: null,
groups: name === 'ungrouped'? [] : [name], groups: name === 'ungrouped'? [] : [name],
fullname: mock.cur_names[i], fullname: mock.cur_names[i]
is_last: i===(mock.cur_names.length-1)
}); });
} }
}, converse)); }, converse));
@ -270,8 +267,7 @@
jid: mock.pend_names[0].replace(/ /g,'.').toLowerCase() + '@localhost', jid: mock.pend_names[0].replace(/ /g,'.').toLowerCase() + '@localhost',
subscription: 'none', subscription: 'none',
ask: 'subscribe', ask: 'subscribe',
fullname: mock.pend_names[0], fullname: mock.pend_names[0]
is_last: true
}); });
}, converse)); }, converse));
waits(300); waits(300);
@ -309,8 +305,7 @@
jid: name.replace(/ /g,'.').toLowerCase() + '@localhost', jid: name.replace(/ /g,'.').toLowerCase() + '@localhost',
subscription: 'none', subscription: 'none',
ask: 'subscribe', ask: 'subscribe',
fullname: name, fullname: name
is_last: true
}); });
expect(this.rosterview.get('Pending contacts').$el.is(':visible')).toEqual(true); expect(this.rosterview.get('Pending contacts').$el.is(':visible')).toEqual(true);
converse.rosterview.$el.find(".pending-contact-name:contains('"+name+"')") converse.rosterview.$el.find(".pending-contact-name:contains('"+name+"')")
@ -334,17 +329,15 @@
it("can be added to the roster and they will be sorted alphabetically", $.proxy(function () { it("can be added to the roster and they will be sorted alphabetically", $.proxy(function () {
_clearContacts(); _clearContacts();
var i, t, is_last; var i, t;
spyOn(converse, 'emit'); spyOn(converse, 'emit');
spyOn(this.rosterview, 'update').andCallThrough(); spyOn(this.rosterview, 'update').andCallThrough();
for (i=0; i<mock.pend_names.length; i++) { for (i=0; i<mock.pend_names.length; i++) {
is_last = i===(mock.pend_names.length-1);
this.roster.create({ this.roster.create({
jid: mock.pend_names[i].replace(/ /g,'.').toLowerCase() + '@localhost', jid: mock.pend_names[i].replace(/ /g,'.').toLowerCase() + '@localhost',
subscription: 'none', subscription: 'none',
ask: 'subscribe', ask: 'subscribe',
fullname: mock.pend_names[i], fullname: mock.pend_names[i]
is_last: is_last
}); });
expect(this.rosterview.update).toHaveBeenCalled(); expect(this.rosterview.update).toHaveBeenCalled();
} }
@ -381,8 +374,7 @@
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,
fullname: mock.cur_names[i], fullname: mock.cur_names[i]
is_last: i===(mock.cur_names.length-1)
}); });
expect(this.rosterview.update).toHaveBeenCalled(); expect(this.rosterview.update).toHaveBeenCalled();
} }
@ -420,8 +412,7 @@
jid: name.replace(/ /g,'.').toLowerCase() + '@localhost', jid: name.replace(/ /g,'.').toLowerCase() + '@localhost',
subscription: 'both', subscription: 'both',
ask: null, ask: null,
fullname: name, fullname: name
is_last: true
}); });
expect(this.rosterview.$el.find('dt.roster-group').css('display')).toEqual('block'); expect(this.rosterview.$el.find('dt.roster-group').css('display')).toEqual('block');
converse.rosterview.$el.find(".open-chat:contains('"+name+"')") converse.rosterview.$el.find(".open-chat:contains('"+name+"')")
@ -582,8 +573,7 @@
subscription: 'none', subscription: 'none',
ask: null, ask: null,
requesting: true, requesting: true,
fullname: mock.req_names[i], fullname: mock.req_names[i]
is_last: i===(mock.req_names.length-1)
}); });
expect(this.rosterview.update).toHaveBeenCalled(); expect(this.rosterview.update).toHaveBeenCalled();
// When a requesting contact is added, the controlbox must // When a requesting contact is added, the controlbox must
@ -606,8 +596,7 @@
subscription: 'none', subscription: 'none',
ask: null, ask: null,
requesting: true, requesting: true,
fullname: name, fullname: name
is_last: true
}); });
expect(this.rosterview.get('Contact requests').$el.is(':visible')).toEqual(true); expect(this.rosterview.get('Contact requests').$el.is(':visible')).toEqual(true);
converse.rosterview.$el.find(".req-contact-name:contains('"+name+"')") converse.rosterview.$el.find(".req-contact-name:contains('"+name+"')")

View File

@ -137,7 +137,6 @@
converse.roster.create({ converse.roster.create({
ask: ask, ask: ask,
fullname: names[i], fullname: names[i],
is_last: i===(names.length-1),
jid: names[i].replace(/ /g,'.').toLowerCase() + '@localhost', jid: names[i].replace(/ /g,'.').toLowerCase() + '@localhost',
requesting: requesting, requesting: requesting,
subscription: subscription subscription: subscription