From 926ad230331a839e706899e9079b16c1ca3159a7 Mon Sep 17 00:00:00 2001
From: syuilo <syuilotan@yahoo.co.jp>
Date: Fri, 25 Jan 2019 10:52:04 +0900
Subject: [PATCH] [Test] Add API test

---
 test/api.ts | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/test/api.ts b/test/api.ts
index 72a0efbbde..30ff32e3d4 100644
--- a/test/api.ts
+++ b/test/api.ts
@@ -1171,4 +1171,31 @@ describe('API', () => {
 			expect(res).have.status(400);
 		}));
 	});
+
+	describe('notes/replies', () => {
+		it('自分に閲覧権限のない投稿は含まれない', async(async () => {
+			const alice = await signup({ username: 'alice' });
+			const bob = await signup({ username: 'bob' });
+			const carol = await signup({ username: 'carol' });
+
+			const alicePost = await post(alice, {
+				text: 'foo'
+			});
+
+			await post(bob, {
+				replyId: alicePost.id,
+				text: 'bar',
+				visibility: 'specified',
+				visibleUserIds: [alice.id]
+			});
+
+			const res = await request('/notes/replies', {
+				noteId: alicePost.id
+			}, carol);
+
+			expect(res).have.status(200);
+			expect(res.body).be.a('array');
+			expect(res.body).length(0);
+		}));
+	});
 });