[Test] Add some tests
This commit is contained in:
		
							parent
							
								
									2cc2ecb13c
								
							
						
					
					
						commit
						2596e82532
					
				
					 1 changed files with 18 additions and 0 deletions
				
			
		
							
								
								
									
										18
									
								
								test/api.js
									
										
									
									
									
								
							
							
						
						
									
										18
									
								
								test/api.js
									
										
									
									
									
								
							|  | @ -403,6 +403,24 @@ describe('API', () => { | ||||||
| 				done(); | 				done(); | ||||||
| 			}); | 			}); | ||||||
| 		})); | 		})); | ||||||
|  | 
 | ||||||
|  | 		it('空のパラメータで怒られる', () => new Promise(async (done) => { | ||||||
|  | 			const me = await insertSakurako(); | ||||||
|  | 			request('/posts/likes/create', {}, me).then(res => { | ||||||
|  | 				res.should.have.status(400); | ||||||
|  | 				done(); | ||||||
|  | 			}); | ||||||
|  | 		})); | ||||||
|  | 
 | ||||||
|  | 		it('間違ったIDで怒られる', () => new Promise(async (done) => { | ||||||
|  | 			const me = await insertSakurako(); | ||||||
|  | 			request('/posts/likes/create', { | ||||||
|  | 				post_id: 'kyoppie' | ||||||
|  | 			}, me).then(res => { | ||||||
|  | 				res.should.have.status(400); | ||||||
|  | 				done(); | ||||||
|  | 			}); | ||||||
|  | 		})); | ||||||
| 	}); | 	}); | ||||||
| 
 | 
 | ||||||
| 	describe('following/create', () => { | 	describe('following/create', () => { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue