summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2019-04-18 14:39:49 +0900
committersyuilo <syuilotan@yahoo.co.jp>2019-04-18 14:39:49 +0900
commit73b683bb4d4cdf7ed0bef59dd1058a6347955d86 (patch)
treef64b54344854894b2e7a14aa39f545124e6e0a6c /test
parentFix #4703 (diff)
downloadsharkey-73b683bb4d4cdf7ed0bef59dd1058a6347955d86.tar.gz
sharkey-73b683bb4d4cdf7ed0bef59dd1058a6347955d86.tar.bz2
sharkey-73b683bb4d4cdf7ed0bef59dd1058a6347955d86.zip
Add test
Diffstat (limited to 'test')
-rw-r--r--test/streaming.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/streaming.ts b/test/streaming.ts
index a9c90c216f..2dfede1380 100644
--- a/test/streaming.ts
+++ b/test/streaming.ts
@@ -484,6 +484,31 @@ describe('Streaming', () => {
});
}));
+ it('フォローしているユーザーのホーム投稿が流れる', () => new Promise(async done => {
+ const alice = await signup({ username: 'alice' });
+ const bob = await signup({ username: 'bob' });
+
+ // Alice が Bob をフォロー
+ await request('/following/create', {
+ userId: bob.id
+ }, alice);
+
+ const ws = await connectStream(alice, 'hybridTimeline', ({ type, body }) => {
+ if (type == 'note') {
+ assert.deepStrictEqual(body.userId, bob.id);
+ assert.deepStrictEqual(body.text, 'foo');
+ ws.close();
+ done();
+ }
+ });
+
+ // ホーム投稿
+ post(bob, {
+ text: 'foo',
+ visibility: 'home'
+ });
+ }));
+
it('フォローしていないローカルユーザーのホーム投稿は流れない', () => new Promise(async done => {
const alice = await signup({ username: 'alice' });
const bob = await signup({ username: 'bob' });