From d962ea3889abf6c4396de2449636415587070de4 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 20 Oct 2023 08:15:31 +0900 Subject: [PATCH] add timeline tests --- packages/backend/test/e2e/streaming.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/backend/test/e2e/streaming.ts b/packages/backend/test/e2e/streaming.ts index 43bbacd207..b3b5f1955f 100644 --- a/packages/backend/test/e2e/streaming.ts +++ b/packages/backend/test/e2e/streaming.ts @@ -261,6 +261,16 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); + test('自分の visibility: followers な投稿が流れる', async () => { + const fired = await waitFire( + ayano, 'hybridTimeline', + () => api('notes/create', { text: 'foo', visibility: 'followers' }, ayano), // ayano posts + msg => msg.type === 'note' && msg.body.text === 'foo', + ); + + assert.strictEqual(fired, true); + }); + test('フォローしていないローカルユーザーの投稿が流れる', async () => { const fired = await waitFire( ayano, 'hybridTimeline', // ayano:Hybrid @@ -313,6 +323,16 @@ describe('Streaming', () => { assert.strictEqual(fired, true); }); + test('フォローしているユーザーの visibility: followers な投稿が流れる', async () => { + const fired = await waitFire( + ayano, 'hybridTimeline', // ayano:Hybrid + () => api('notes/create', { text: 'foo', visibility: 'followers' }, kyoko), + msg => msg.type === 'note' && msg.body.userId === kyoko.id, // wait kyoko + ); + + assert.strictEqual(fired, true); + }); + test('フォローしていないローカルユーザーのホーム投稿は流れない', async () => { const fired = await waitFire( ayano, 'hybridTimeline', // ayano:Hybrid