21 lines
715 B
TypeScript
21 lines
715 B
TypeScript
import { test } from '@japa/runner'
|
|
|
|
test.group('Restaurant menu items', () => {
|
|
test('create', async ({ assert, client }) => {
|
|
const item = {
|
|
name: 'test',
|
|
priceSmall: 10,
|
|
priceLarge: 20,
|
|
description: 'test'
|
|
}
|
|
const response = await client.post('/api/menu-items/create').json(item)
|
|
assert.equal(response.body().name, item.name)
|
|
assert.equal(response.body().priceSmall, item.priceSmall)
|
|
assert.equal(response.body().priceLarge, item.priceLarge)
|
|
assert.equal(response.body().description, item.description)
|
|
}),
|
|
test('get all', async ({ assert, client }) => {
|
|
const response = await client.get('/api/menu-items')
|
|
assert.isArray(response.body())
|
|
})
|
|
}) |