Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Update e2e setup to use current Spree API for product associations (#14872)

Damian Legawiec539a2b92db9a
diff --git a/packages/dashboard/e2e/global-setup.ts b/packages/dashboard/e2e/global-setup.ts
index 51d575d334..b6eed3499f 100644
--- a/packages/dashboard/e2e/global-setup.ts
+++ b/packages/dashboard/e2e/global-setup.ts
@@ -80,12 +80,12 @@ const BOOTSTRAP_RUBY = [
`product = Spree::Product.where(name: '${FIXTURE_PROMO_PRODUCT}').first_or_create!(store: s, status: 'active')`,
`product.default_variant.set_price(s.default_currency, 19.99)`,
`product.default_variant.update!(sku: '${FIXTURE_PROMO_SKU}') if product.default_variant.sku != '${FIXTURE_PROMO_SKU}'`,
- `product.taxons << category unless product.taxons.include?(category)`,
+ `product.categories << category unless product.categories.include?(category)`,
// Stock the promo product on the store's default stock location so
// order-creation tests can add it to a draft order without the
// +"Quantity not available"+ validation kicking in.
`default_location = s.default_stock_location`,
- `product.variants_including_master.each { |v| default_location.stock_levels.where(variant: v).first_or_create!.update!(count_on_hand: 100, backorderable: true) }`,
+ `product.variants.each { |v| default_location.stock_levels.where(variant: v).first_or_create!.update!(count_on_hand: 100, backorderable: true) }`,
// Disjoint product fixtures for products-bulk.spec.ts. Each test owns its
// own pair (A/B → status, C/D → categories, E/F → tags, G/H → delete,
// I → row-action clone/delete) so the serial suite can mutate them in any