forked from FoundKeyGang/FoundKey
[Test] Add API test
This commit is contained in:
parent
5eca0a31f7
commit
926ad23033
1 changed files with 27 additions and 0 deletions
27
test/api.ts
27
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);
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue