feat: Product filtering (#439)

This commit is contained in:
pKorsholm
2021-10-13 16:01:59 +02:00
committed by GitHub
parent c0e947f47a
commit 5ef2a3fbcb
11 changed files with 707 additions and 31 deletions

View File

@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`/admin/discounts creates store session correctly 1`] = `
exports[`/admin/auth creates store session correctly 1`] = `
Object {
"billing_address_id": null,
"created_at": Any<String>,
@@ -15,4 +15,4 @@ Object {
"phone": "12345678",
"updated_at": Any<String>,
}
`;
`;

View File

@@ -152,16 +152,16 @@ describe("/store/carts", () => {
expect.assertions(2)
const api = useApi()
try {
await api.post("/store/carts/test-cart", {
discounts: [{ code: "CREATED" }],
let response = await api
.post("/store/carts/test-cart", {
discounts: [{ code: "SPENT" }],
})
.catch((error) => {
expect(error.response.status).toEqual(400)
expect(error.response.data.message).toEqual(
"Discount has been used maximum allowed times"
)
})
} catch (error) {
expect(error.response.status).toEqual(400)
expect(error.response.data.message).toEqual(
"Discount has been used maximum allowed times"
)
}
})
it("fails to apply expired discount", async () => {