fix(order): Handling bad order data

This commit is contained in:
Chris Troutner
2022-07-07 13:45:01 -07:00
parent 1e80a3159e
commit d1e96505c8
2 changed files with 11 additions and 3 deletions
+8 -2
View File
@@ -125,12 +125,18 @@ describe('#order-use-case', () => {
it('should catch and throw an error', async () => {
try {
await uut.createOrder()
await uut.createOrder({ a: 'b' })
assert.fail('Unexpected code path')
} catch (err) {
assert.include(err.message, 'Cannot set')
assert.include(err.message, 'entry does not contain required properties')
}
})
it('should exit quietly if the entry is empty', async () => {
const result = await uut.createOrder()
assert.equal(result, false)
})
})
})