Render group updates
Not pretty, but it works. Also allows for later localization. Copy/behavior is borrowed from the Android client. Closes #104 Fixes #65
This commit is contained in:
parent
bcff1cf991
commit
d52db8fe6f
6 changed files with 102 additions and 25 deletions
16
test/views/group_update_view_test.js
Normal file
16
test/views/group_update_view_test.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
describe('GroupUpdateView', function() {
|
||||
it('should show new group members', function() {
|
||||
var view = new Whisper.GroupUpdateView({model: {joined: ['Alice', 'Bob']}}).render();
|
||||
assert.match(view.$el.text(), /Alice.*Bob.*joined the group/);
|
||||
});
|
||||
|
||||
it('should note updates to the title', function() {
|
||||
var view = new Whisper.GroupUpdateView({model: {name: 'New name'}}).render();
|
||||
assert.match(view.$el.text(), /Title is now 'New name'/);
|
||||
});
|
||||
|
||||
it('should say "Updated the group"', function() {
|
||||
var view = new Whisper.GroupUpdateView({model: {avatar: 'New avatar'}}).render();
|
||||
assert.match(view.$el.text(), /Updated the group/);
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue