From 76fcf122f99758a0a95b787f6b0e401f05341101 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 25 Jan 2019 10:58:39 +0900 Subject: [PATCH] [Test] Add notes/timeline test --- test/api.ts | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/api.ts b/test/api.ts index 30ff32e3d..67edf3dfc 100644 --- a/test/api.ts +++ b/test/api.ts @@ -1198,4 +1198,27 @@ describe('API', () => { expect(res.body).length(0); })); }); + + describe('notes/timeline', () => { + it('フォロワー限定投稿が含まれる', async(async () => { + const alice = await signup({ username: 'alice' }); + const bob = await signup({ username: 'bob' }); + + await request('/following/create', { + userId: alice.id + }, bob); + + const alicePost = await post(alice, { + text: 'foo', + visibility: 'followers' + }); + + const res = await request('/notes/timeline', {}, bob); + + expect(res).have.status(200); + expect(res.body).be.a('array'); + expect(res.body).length(1); + expect(res.body[0].id).equals(alicePost.id); + })); + }); });