diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2019-01-25 10:52:04 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2019-01-25 10:52:04 +0900 |
| commit | 926ad230331a839e706899e9079b16c1ca3159a7 (patch) | |
| tree | 7221cfbae555449260ed0b252dbac784ecb3fa59 /test/api.ts | |
| parent | Filter hidden replies / mentions (#3981) (diff) | |
| download | sharkey-926ad230331a839e706899e9079b16c1ca3159a7.tar.gz sharkey-926ad230331a839e706899e9079b16c1ca3159a7.tar.bz2 sharkey-926ad230331a839e706899e9079b16c1ca3159a7.zip | |
[Test] Add API test
Diffstat (limited to 'test/api.ts')
| -rw-r--r-- | test/api.ts | 27 |
1 files changed, 27 insertions, 0 deletions
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); + })); + }); }); |