mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-26 19:14:12 +00:00 
			
		
		
		
	[Test] Add notes/timeline test
This commit is contained in:
		
							parent
							
								
									926ad23033
								
							
						
					
					
						commit
						76fcf122f9
					
				
					 1 changed files with 23 additions and 0 deletions
				
			
		
							
								
								
									
										23
									
								
								test/api.ts
									
										
									
									
									
								
							
							
						
						
									
										23
									
								
								test/api.ts
									
										
									
									
									
								
							|  | @ -1198,4 +1198,27 @@ describe('API', () => { | ||||||
| 			expect(res.body).length(0); | 			expect(res.body).length(0); | ||||||
| 		})); | 		})); | ||||||
| 	}); | 	}); | ||||||
|  | 
 | ||||||
|  | 	describe('notes/timeline', () => { | ||||||
|  | 		it('フォロワー限定投稿が含まれる', async(async () => { | ||||||
|  | 			const alice = await signup({ username: 'alice' }); | ||||||
|  | 			const bob = await signup({ username: 'bob' }); | ||||||
|  | 
 | ||||||
|  | 			await request('/following/create', { | ||||||
|  | 				userId: alice.id | ||||||
|  | 			}, bob); | ||||||
|  | 
 | ||||||
|  | 			const alicePost = await post(alice, { | ||||||
|  | 				text: 'foo', | ||||||
|  | 				visibility: 'followers' | ||||||
|  | 			}); | ||||||
|  | 
 | ||||||
|  | 			const res = await request('/notes/timeline', {}, bob); | ||||||
|  | 
 | ||||||
|  | 			expect(res).have.status(200); | ||||||
|  | 			expect(res.body).be.a('array'); | ||||||
|  | 			expect(res.body).length(1); | ||||||
|  | 			expect(res.body[0].id).equals(alicePost.id); | ||||||
|  | 		})); | ||||||
|  | 	}); | ||||||
| }); | }); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue