db-vendo-client/test/e2e/lib/journeys-fails-with-no-product.js

22 lines
382 B
JavaScript
Raw Normal View History

2021-12-29 18:53:50 +01:00
const journeysFailsWithNoProduct = async (cfg) => {
const {
test: t,
fetchJourneys,
fromId,
toId,
when,
products
} = cfg
2018-11-13 20:34:12 +01:00
const noProducts = Object.create(null)
for (let p of products) noProducts[p.id] = false
2021-12-29 18:53:50 +01:00
await t.rejects(async () => {
await fetchJourneys(fromId, toId, {departure: when, products: noProducts})
})
}
2022-05-07 16:17:37 +02:00
export {
journeysFailsWithNoProduct,
}