tests(integration): Randomize option value name (#2918)

This commit is contained in:
Philip Korsholm authored and GitHub committed 2022-12-29 18:15:10 +01:00
1 parent 645e0d0ec5
commit 90d774f563
1 file changed
+2 -2
@@ -14,7 +14,7 @@ export type ProductVariantFactoryData = {
inventory_quantity?: number inventory_quantity?: number
title?: string title?: string
options?: { option_id: string; value: string }[] options?: { option_id: string; value: string }[]
prices?: { currency: string; amount: number, region_id?: string }[] prices?: { currency: string; amount: number; region_id?: string }[]
} }
export const simpleProductVariantFactory = async ( export const simpleProductVariantFactory = async (
@@ -45,7 +45,7 @@ export const simpleProductVariantFactory = async (
const options = data.options || [{ option_id: "test-option", value: "Large" }] const options = data.options || [{ option_id: "test-option", value: "Large" }]
for (const o of options) { for (const o of options) {
await manager.insert(ProductOptionValue, { await manager.insert(ProductOptionValue, {
id: `${o.value}-${o.option_id}`, id: `${variant.id}-${o.option_id ?? Math.random()}`,
value: o.value, value: o.value,
variant_id: id, variant_id: id,
option_id: o.option_id, option_id: o.option_id,