Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit da77f80

Browse files
authored
Chat-307 Direct Message and Feed Tests (#364)
* direct chat test * feed chat test * patch for set interval * lint tests * rewrite feed and direct tests * refactor tests for simpler execution * try for fix * ok lets find out whats happening on travis * more debug * log * try this on travis * good ol setinterval * setinterval works, remove console logs * ok setTimeout rather than interval * add 't' to shouldFeedCha
1 parent 9cd34e0 commit da77f80

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

test/integration/main.test.js

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ describe('remote chat list', () => {
927927

928928
});
929929

930-
describe('invite', () => {
930+
describe('private channels work', () => {
931931

932932
beforeEach(reset);
933933
beforeEach(createChatEngine);
@@ -984,6 +984,39 @@ describe('invite', () => {
984984

985985
});
986986

987+
it('direct chat works', function shouldDirect(done) {
988+
989+
this.timeout(60000);
990+
991+
ChatEngine.me.direct.on('anything', () => {
992+
done();
993+
});
994+
995+
let u = new ChatEngineYou.User(username);
996+
u.direct.connect();
997+
u.direct.once('$.connected', () => {
998+
u.direct.emit('anything', { test: true });
999+
});
1000+
1001+
});
1002+
1003+
it('feed chat works', function shouldFeedChat(done) {
1004+
1005+
this.timeout(60000);
1006+
1007+
let u = new ChatEngineYou.User(username);
1008+
1009+
setTimeout(() => {
1010+
ChatEngine.me.feed.emit('anything', { test: true });
1011+
}, 12000);
1012+
1013+
u.feed.connect();
1014+
u.feed.once('anything', () => {
1015+
done();
1016+
});
1017+
1018+
});
1019+
9871020
});
9881021

9891022
describe('state', () => {

0 commit comments

Comments
 (0)