テストケースがバグってたので修正

This commit is contained in:
rinsuki 2019-10-25 20:24:00 +09:00
parent 7394de3ae3
commit e0d4353d98
1 changed files with 7 additions and 4 deletions

View File

@ -37,6 +37,8 @@ describe('API visibility', () => {
let other: any; let other: any;
/** 非フォロワーでもリプライやメンションをされた人 */ /** 非フォロワーでもリプライやメンションをされた人 */
let target: any; let target: any;
/** specified mentionでmentionを飛ばされる人 */
let target2: any;
/** public-post */ /** public-post */
let pub: any; let pub: any;
@ -82,6 +84,7 @@ describe('API visibility', () => {
follower = await signup({ username: 'follower' }); follower = await signup({ username: 'follower' });
other = await signup({ username: 'other' }); other = await signup({ username: 'other' });
target = await signup({ username: 'target' }); target = await signup({ username: 'target' });
target2 = await signup({ username: 'target2' });
// follow alice <= follower // follow alice <= follower
await request('/following/create', { userId: alice.id }, follower); await request('/following/create', { userId: alice.id }, follower);
@ -103,7 +106,7 @@ describe('API visibility', () => {
pubM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'public' }); pubM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'public' });
homeM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'home' }); homeM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'home' });
folM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'followers' }); folM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'followers' });
speM = await post(alice, { text: '@target x', replyId: tgt.id, visibility: 'specified' }); speM = await post(alice, { text: '@target2 x', replyId: tgt.id, visibility: 'specified' });
//#endregion //#endregion
}); });
@ -391,16 +394,16 @@ describe('API visibility', () => {
// specified // specified
it('[show] specified-mentionを自分が見れる', async(async () => { it('[show] specified-mentionを自分が見れる', async(async () => {
const res = await show(speM.id, alice); const res = await show(speM.id, alice);
assert.strictEqual(res.body.text, '@target x'); assert.strictEqual(res.body.text, '@target2 x');
})); }));
it('[show] specified-mentionを指定ユーザーが見れる', async(async () => { it('[show] specified-mentionを指定ユーザーが見れる', async(async () => {
const res = await show(speM.id, target); const res = await show(speM.id, target);
assert.strictEqual(res.body.text, '@target x'); assert.strictEqual(res.body.text, '@target2 x');
})); }));
it('[show] specified-mentionをされた人が指定されてなかったら見れない', async(async () => { it('[show] specified-mentionをされた人が指定されてなかったら見れない', async(async () => {
const res = await show(speM.id, target); const res = await show(speM.id, target2);
assert.strictEqual(res.body.isHidden, true); assert.strictEqual(res.body.isHidden, true);
})); }));