fix: Several fixes to store product endpoints, moved several test suites to HTTP (#7601)

* chore: Move publishable api key tests to HTTP

* chore: Move store tests to HTTP folder

* fix: Add tests for store products, fix several bugs around publishable keys
This commit is contained in:
Stevche Radevski
2024-06-04 21:00:07 +02:00
committed by GitHub
parent d104d1a256
commit e44fe78b96
24 changed files with 2301 additions and 2763 deletions
+42
View File
@@ -0,0 +1,42 @@
import { HttpTypes } from "@medusajs/types"
export const getProductFixture = (
overrides: Partial<HttpTypes.AdminProduct>
) => ({
title: "Test fixture",
description: "test-product-description",
status: "draft",
// BREAKING: Images input changed from string[] to {url: string}[]
images: [{ url: "test-image.png" }, { url: "test-image-2.png" }],
tags: [{ value: "123" }, { value: "456" }],
// BREAKING: Options input changed from {title: string}[] to {title: string, values: string[]}[]
options: [
{ title: "size", values: ["large", "small"] },
{ title: "color", values: ["green"] },
],
variants: [
{
title: "Test variant",
prices: [
{
currency_code: "usd",
amount: 100,
},
{
currency_code: "eur",
amount: 45,
},
{
currency_code: "dkk",
amount: 30,
},
],
// BREAKING: Options input changed from {value: string}[] to {[optionTitle]: optionValue} map
options: {
size: "large",
color: "green",
},
},
],
...(overrides ?? {}),
})