few more routes added. process of refactoring controllers still underway

This commit is contained in:
Mikayla Dobson
2022-12-12 20:32:22 -06:00
parent d2b06ced7a
commit 5234e54bcc
5 changed files with 53 additions and 26 deletions

View File

@@ -0,0 +1,23 @@
import request from 'supertest'
import { IRecipe } from '../../../schemas'
const server = request.agent('localhost:8080');
describe('/recipe', () => {
beforeAll(async () => {
// to do: create session user,
// use it to log in on this test,
// use the authenticated session to view recipes
// await server.post('/auth/login')
// .body()
})
describe('GET /', () => {
test('gets an array of recipes', async () => {
const result = await request('localhost:8080').get('/recipe');
const data = JSON.parse(result.text);
expect(data.length).toBeGreaterThan(0);
})
})
})