Files
paprika-api/tests/unit/restaurant_menu_items/create.spec.ts
T
2025-07-28 13:00:46 +02:00

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())
})
})