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

24 lines
397 B
JavaScript
Raw Permalink Normal View History

2021-12-29 18:53:50 +01:00
const journeysFailsWithNoProduct = async (cfg) => {
const {
test: t,
fetchJourneys,
fromId,
toId,
when,
products,
} = cfg;
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,
};