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.

Record the settled decisions and cover the card's tracking controls

Damian Legawiec7b91ac7610d1
diff --git a/packages/dashboard/e2e/order-fulfillments.spec.ts b/packages/dashboard/e2e/order-fulfillments.spec.ts
index 459905b4f5..42548bb867 100644
--- a/packages/dashboard/e2e/order-fulfillments.spec.ts
+++ b/packages/dashboard/e2e/order-fulfillments.spec.ts
@@ -72,4 +72,18 @@ test.describe('order fulfillments', () => {
await expect(card.getByText(new RegExp(FIXTURE_PROMO_PRODUCT, 'i')).first()).toBeVisible()
await expect(card.getByRole('button', { name: /actions for/i })).toHaveCount(0)
})
+ // Tracking is a Spree::Delivery since 6.0, and a draft has no fulfillment
+ // record to hang one off — so the card offers no tracking controls until
+ // the order is placed. Anything else would present an action that can only
+ // fail.
+ test('offers no tracking or label controls on a draft', async ({ page }) => {
+ const creds = await login(page)
+ await createDraftOrder(page, creds.store_id)
+
+ const card = fulfillmentsCard(page)
+ await expect(card.getByText(/unfulfilled \(\d+\)/i)).toBeVisible({ timeout: 15_000 })
+ await expect(card.getByRole('button', { name: /add tracking/i })).toHaveCount(0)
+ await expect(card.getByRole('button', { name: /buy label/i })).toHaveCount(0)
+ await expect(card.getByRole('button', { name: /print label/i })).toHaveCount(0)
+ })
})