Update timelines.ts
This commit is contained in:
		| @@ -145,6 +145,7 @@ describe('Timelines', () => { | |||||||
|  |  | ||||||
| 			assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); | 			assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); | ||||||
| 			assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); | 			assert.strictEqual(res.body.some((note: any) => note.id === carolNote.id), true); | ||||||
|  | 			assert.strictEqual(res.body.find((note: any) => note.id === carolNote.id).text, 'hi'); | ||||||
| 		}); | 		}); | ||||||
|  |  | ||||||
| 		test('withReplies: true でフォローしているユーザーの行った別のフォローしているユーザーの投稿への visibility: specified な返信が含まれない', async () => { | 		test('withReplies: true でフォローしているユーザーの行った別のフォローしているユーザーの投稿への visibility: specified な返信が含まれない', async () => { | ||||||
| @@ -501,6 +502,20 @@ describe('Timelines', () => { | |||||||
| 			assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); | 			assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); | ||||||
| 		}); | 		}); | ||||||
|  |  | ||||||
|  | 		test('リスインしているフォローしていないユーザーの visibility: home なノートが含まれる', async () => { | ||||||
|  | 			const [alice, bob] = await Promise.all([signup(), signup()]); | ||||||
|  |  | ||||||
|  | 			const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); | ||||||
|  | 			await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); | ||||||
|  | 			const bobNote = await post(bob, { text: 'hi', visibility: 'home' }); | ||||||
|  |  | ||||||
|  | 			await sleep(100); // redisに追加されるのを待つ | ||||||
|  |  | ||||||
|  | 			const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); | ||||||
|  |  | ||||||
|  | 			assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); | ||||||
|  | 		}); | ||||||
|  |  | ||||||
| 		test('リスインしているフォローしていないユーザーの visibility: followers なノートが含まれない', async () => { | 		test('リスインしているフォローしていないユーザーの visibility: followers なノートが含まれない', async () => { | ||||||
| 			const [alice, bob] = await Promise.all([signup(), signup()]); | 			const [alice, bob] = await Promise.all([signup(), signup()]); | ||||||
|  |  | ||||||
| @@ -514,6 +529,37 @@ describe('Timelines', () => { | |||||||
|  |  | ||||||
| 			assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); | 			assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), false); | ||||||
| 		}); | 		}); | ||||||
|  |  | ||||||
|  | 		test('リスインしているフォローしているユーザーの visibility: home なノートが含まれる', async () => { | ||||||
|  | 			const [alice, bob] = await Promise.all([signup(), signup()]); | ||||||
|  |  | ||||||
|  | 			await api('/following/create', { userId: bob.id }, alice); | ||||||
|  | 			const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); | ||||||
|  | 			await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); | ||||||
|  | 			const bobNote = await post(bob, { text: 'hi', visibility: 'home' }); | ||||||
|  |  | ||||||
|  | 			await sleep(100); // redisに追加されるのを待つ | ||||||
|  |  | ||||||
|  | 			const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); | ||||||
|  |  | ||||||
|  | 			assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); | ||||||
|  | 		}); | ||||||
|  |  | ||||||
|  | 		test('リスインしているフォローしているユーザーの visibility: followers なノートが含まれる', async () => { | ||||||
|  | 			const [alice, bob] = await Promise.all([signup(), signup()]); | ||||||
|  |  | ||||||
|  | 			await api('/following/create', { userId: bob.id }, alice); | ||||||
|  | 			const list = await api('/users/lists/create', { name: 'list' }, alice).then(res => res.body); | ||||||
|  | 			await api('/users/lists/push', { listId: list.id, userId: bob.id }, alice); | ||||||
|  | 			const bobNote = await post(bob, { text: 'hi', visibility: 'followers' }); | ||||||
|  |  | ||||||
|  | 			await sleep(100); // redisに追加されるのを待つ | ||||||
|  |  | ||||||
|  | 			const res = await api('/notes/user-list-timeline', { listId: list.id }, alice); | ||||||
|  |  | ||||||
|  | 			assert.strictEqual(res.body.some((note: any) => note.id === bobNote.id), true); | ||||||
|  | 			assert.strictEqual(res.body.find((note: any) => note.id === bobNote.id).text, 'hi'); | ||||||
|  | 		}); | ||||||
| 	}); | 	}); | ||||||
|  |  | ||||||
| 	// TODO: リノートミュート済みユーザーのテスト | 	// TODO: リノートミュート済みユーザーのテスト | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 syuilo
					syuilo