Refactor messages model; New timeline react components
This commit is contained in:
parent
d342b23cbc
commit
c41bc53614
31 changed files with 1463 additions and 3395 deletions
|
@ -1,62 +0,0 @@
|
|||
/* global ConversationController, textsecure, Whisper */
|
||||
|
||||
describe('InboxView', () => {
|
||||
let inboxView;
|
||||
let conversation;
|
||||
|
||||
before(async () => {
|
||||
ConversationController.reset();
|
||||
await ConversationController.load();
|
||||
await textsecure.storage.user.setNumberAndDeviceId(
|
||||
'18005554444',
|
||||
1,
|
||||
'Home Office'
|
||||
);
|
||||
await ConversationController.getOrCreateAndWait(
|
||||
textsecure.storage.user.getNumber(),
|
||||
'private'
|
||||
);
|
||||
inboxView = new Whisper.InboxView({
|
||||
model: {},
|
||||
window,
|
||||
initialLoadComplete() {},
|
||||
}).render();
|
||||
|
||||
conversation = new Whisper.Conversation({
|
||||
id: '1234',
|
||||
type: 'private',
|
||||
});
|
||||
});
|
||||
|
||||
describe('the conversation stack', () => {
|
||||
it('should be rendered', () => {
|
||||
assert.ok(inboxView.$('.conversation-stack').length === 1);
|
||||
});
|
||||
|
||||
describe('opening a conversation', () => {
|
||||
let triggeredOpenedCount = 0;
|
||||
|
||||
before(() => {
|
||||
conversation.on('opened', () => {
|
||||
triggeredOpenedCount += 1;
|
||||
});
|
||||
|
||||
inboxView.conversation_stack.open(conversation);
|
||||
});
|
||||
|
||||
it('should trigger an opened event', () => {
|
||||
assert.ok(triggeredOpenedCount === 1);
|
||||
});
|
||||
|
||||
describe('and then opening it again immediately', () => {
|
||||
before(() => {
|
||||
inboxView.conversation_stack.open(conversation);
|
||||
});
|
||||
|
||||
it('should trigger the opened event again', () => {
|
||||
assert.ok(triggeredOpenedCount === 2);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue