test(backend): refactor tests (#13499)
* test(backend): refactor tests * fix: failed test
This commit is contained in:
parent
efda2e9baa
commit
38837bd388
24 changed files with 1270 additions and 1297 deletions
|
|
@ -19,15 +19,15 @@ describe('FF visibility', () => {
|
|||
}, 1000 * 60 * 2);
|
||||
|
||||
test('followingVisibility, followersVisibility がともに public なユーザーのフォロー/フォロワーを誰でも見れる', async () => {
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
|
|
@ -39,36 +39,36 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followingVisibility が public であれば followersVisibility の設定に関わらずユーザーのフォローを誰でも見れる', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followingRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followingRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
|
|
@ -78,36 +78,36 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followersVisibility が public であれば followingVisibility の設定に関わらずユーザーのフォロワーを誰でも見れる', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followersRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followersRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
|
|
@ -116,15 +116,15 @@ describe('FF visibility', () => {
|
|||
});
|
||||
|
||||
test('followingVisibility, followersVisibility がともに followers なユーザーのフォロー/フォロワーを自分で見れる', async () => {
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
|
||||
|
|
@ -136,36 +136,36 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followingVisibility が followers なユーザーのフォローを followersVisibility の設定に関わらず自分で見れる', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followingRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followingRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
|
|
@ -175,36 +175,36 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followersVisibility が followers なユーザーのフォロワーを followingVisibility の設定に関わらず自分で見れる', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followersRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followersRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
|
|
@ -213,15 +213,15 @@ describe('FF visibility', () => {
|
|||
});
|
||||
|
||||
test('followingVisibility, followersVisibility がともに followers なユーザーのフォロー/フォロワーを非フォロワーが見れない', async () => {
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
|
|
@ -231,34 +231,34 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followingVisibility が followers なユーザーのフォローを followersVisibility の設定に関わらず非フォロワーが見れない', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 400);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 400);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 400);
|
||||
|
|
@ -267,34 +267,34 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followersVisibility が followers なユーザーのフォロワーを followingVisibility の設定に関わらず非フォロワーが見れない', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 400);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 400);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 400);
|
||||
|
|
@ -302,19 +302,19 @@ describe('FF visibility', () => {
|
|||
});
|
||||
|
||||
test('followingVisibility, followersVisibility がともに followers なユーザーのフォロー/フォロワーをフォロワーが見れる', async () => {
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
await api('/following/create', {
|
||||
await api('following/create', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
|
|
@ -326,45 +326,45 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followingVisibility が followers なユーザーのフォローを followersVisibility の設定に関わらずフォロワーが見れる', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
await api('/following/create', {
|
||||
await api('following/create', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followingRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
await api('/following/create', {
|
||||
await api('following/create', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followingRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
await api('/following/create', {
|
||||
await api('following/create', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
|
|
@ -374,45 +374,45 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followersVisibility が followers なユーザーのフォロワーを followingVisibility の設定に関わらずフォロワーが見れる', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
await api('/following/create', {
|
||||
await api('following/create', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followersRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
await api('/following/create', {
|
||||
await api('following/create', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followersRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
await api('/following/create', {
|
||||
await api('following/create', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
|
|
@ -421,15 +421,15 @@ describe('FF visibility', () => {
|
|||
});
|
||||
|
||||
test('followingVisibility, followersVisibility がともに private なユーザーのフォロー/フォロワーを自分で見れる', async () => {
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
|
||||
|
|
@ -441,36 +441,36 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followingVisibility が private なユーザーのフォローを followersVisibility の設定に関わらず自分で見れる', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followingRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followingRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followingRes.status, 200);
|
||||
|
|
@ -480,36 +480,36 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followersVisibility が private なユーザーのフォロワーを followingVisibility の設定に関わらず自分で見れる', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followersRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
assert.strictEqual(Array.isArray(followersRes.body), true);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, alice);
|
||||
assert.strictEqual(followersRes.status, 200);
|
||||
|
|
@ -518,15 +518,15 @@ describe('FF visibility', () => {
|
|||
});
|
||||
|
||||
test('followingVisibility, followersVisibility がともに private なユーザーのフォロー/フォロワーを他人が見れない', async () => {
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
|
||||
|
|
@ -536,34 +536,34 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followingVisibility が private なユーザーのフォローを followersVisibility の設定に関わらず他人が見れない', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 400);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 400);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followingRes = await api('/users/following', {
|
||||
const followingRes = await api('users/following', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followingRes.status, 400);
|
||||
|
|
@ -572,34 +572,34 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followersVisibility が private なユーザーのフォロワーを followingVisibility の設定に関わらず他人が見れない', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 400);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 400);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
const followersRes = await api('/users/followers', {
|
||||
const followersRes = await api('users/followers', {
|
||||
userId: alice.id,
|
||||
}, bob);
|
||||
assert.strictEqual(followersRes.status, 400);
|
||||
|
|
@ -609,7 +609,7 @@ describe('FF visibility', () => {
|
|||
describe('AP', () => {
|
||||
test('followingVisibility が public 以外ならばAPからはフォローを取得できない', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
|
|
@ -617,7 +617,7 @@ describe('FF visibility', () => {
|
|||
assert.strictEqual(followingRes.status, 200);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
|
|
@ -625,7 +625,7 @@ describe('FF visibility', () => {
|
|||
assert.strictEqual(followingRes.status, 403);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followingVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
|
|
@ -636,7 +636,7 @@ describe('FF visibility', () => {
|
|||
|
||||
test('followersVisibility が public 以外ならばAPからはフォロワーを取得できない', async () => {
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followersVisibility: 'public',
|
||||
}, alice);
|
||||
|
||||
|
|
@ -644,7 +644,7 @@ describe('FF visibility', () => {
|
|||
assert.strictEqual(followersRes.status, 200);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followersVisibility: 'followers',
|
||||
}, alice);
|
||||
|
||||
|
|
@ -652,7 +652,7 @@ describe('FF visibility', () => {
|
|||
assert.strictEqual(followersRes.status, 403);
|
||||
}
|
||||
{
|
||||
await api('/i/update', {
|
||||
await api('i/update', {
|
||||
followersVisibility: 'private',
|
||||
}, alice);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue