LastSeenIndicatorView: programmatic tests, tweak to manual tests

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-05-18 12:26:43 -07:00
parent 1608acf449
commit 318162e74a
2 changed files with 19 additions and 0 deletions

View file

@ -5,6 +5,7 @@ Some things are very difficult to test programmatically. Also, if you don't have
Conversation view:
Last seen indicator:
- Make window small, switch away from conversation, receive messages that would more than fill up the window, switch back to conversation: the 'N unread messages' text should be at the top of the window, most recent message should be off-screen
(do this with conversation already loaded and with conversation not previously loaded )
- Receive more messages while this is showing - the number should increment, and the window should not scroll
- Scroll to the bottom of the window, receive more messages - each message should scroll the window down, so the latest message stays at the bottom of the window.
- Increase the size of the window so that the 'N unread messages' text is showing. It should reflect the total count of messages below it

View file

@ -0,0 +1,18 @@
/*
* vim: ts=4:sw=4:expandtab
*/
describe('LastSeenIndicatorView', function() {
// TODO: in electron branch, wheere we have access to real i18n, test rendered HTML
it('renders provided count', function() {
var view = new Whisper.LastSeenIndicatorView({count: 10});
assert.equal(view.count, 10);
});
it('increments count', function() {
var view = new Whisper.LastSeenIndicatorView({count: 4});
assert.equal(view.count, 4);
view.increment(3);
assert.equal(view.count, 7);
});
});