Testing the customer flow
End-to-end test plan for verifying the reorder portal works on your dev store.
Prereqs
Reorder reminders enabled (Apps → Orders → Reorder Settings → Schedule → Enable ON)
At least one Customer Group with a test customer in it
Customer has an email address on Shopify (
customer.email)SMTP configured (Settings → Email Settings → SMTP)
Test customer's
emailMarketingConsent.marketingStateisSUBSCRIBED(if your settings require it)
Test 1: Portal access (eligible customer)
Log into the storefront as your test B2B customer
Navigate directly to:
https://your-shop.myshopify.com/apps/orbit-boost-wholesale/portal/ordersExpected: orders list page with recent orders + Reorder buttons
Click Reorder on any order
Expected:
/portal/reorder?order=<id>page loads with each line item, checkbox, qty stepper, B2B priceAdjust qty / deselect items
Click Add selected to cart
Expected: cart updates with selected items + redirect to
/cart
Test 2: Portal access (ineligible customer)
Log in as a non-B2B customer (no Customer Group membership)
Navigate to
/apps/orbit-boost-wholesale/portal/ordersExpected: "Reorder is available for B2B accounts only" message
Test 3: Portal access (guest)
Log out completely
Navigate to
/apps/orbit-boost-wholesale/portal/ordersExpected: "Please log in to reorder" message
Test 4: Reminder email cron
The cron runs daily at 06:00 UTC. To force a same-day test:
In Reorder Settings → Schedule, set First reminder to
0days (or whatever delay you want to test)Save
Place a test order on the storefront as your B2B customer
Fulfill the order in Shopify Admin → Orders
Wait for 06:00 UTC (or trigger the cron manually if you have backend access — see below)
Customer email inbox should receive a reminder
Triggering the cron manually (dev only)
If you have backend SSH access or run the app locally:
Watch logs for [reorderReminderJob] lines indicating which shops were processed and which orders matched.
Test 5: Unsubscribe link
Receive a reminder email (Test 4)
Click the unsubscribe link at the bottom
Expected: "You have been unsubscribed from reorder reminder emails from this store" confirmation page
Verify in MongoDB:
ReorderUnsubscribecollection has a new entry with hashed emailFuture cron runs should skip this customer
Test 6: Reminder dedupe
Run the cron once for a delay → customer gets email A
Re-run the cron same day → customer should NOT get a second email
Verify:
ReorderRemindercollection has exactly one entry with(shop, orderId, step=1)
Test 7: Marketing consent gate
In Reorder Settings → Schedule, ensure Only send to customers with marketing consent is ON
In Shopify Admin → Customers → your test customer → set email marketing to
Unsubscribed(or never opted in)Trigger cron
Customer should NOT receive reminder
Set their consent back to
SubscribedTrigger cron next day (or skip dedupe via DB reset)
Customer should receive reminder
Test 8: Wholesale-aware pricing
Place an order as a customer with no B2B group (retail price)
Add that customer to a B2B Customer Group with a Wholesale Discount rule (e.g. 20% off all products)
Visit
/portal/reorder?order=<original_order_id>as that customerExpected: each line item's price shows the WHOLESALE price (post-discount), not the retail price the original order was placed at
Add selected to cart → cart confirms the wholesale price
Test 9: Out-of-stock variant
Set one variant's inventory to 0 (track inventory + zero stock)
Reorder an old order that includes that variant
Expected: the variant's row shows "Out of stock" status, checkbox disabled, qty stepper readonly
Add selected → only available items added to cart
Test 10: Discontinued variant
Delete a variant from a product that's in a customer's order history
Reorder that order
Expected: the variant's row shows "No longer available", checkbox disabled, row dimmed
Troubleshooting
No orders shown → customer has no orders or wasn't tagged
orb2b-b2b. Check Shopify Admin → Orders for theorb2b-b2btag"Not eligible" but customer should be eligible → verify customer's Shopify customer record has the group tag. CustomerGroupService syncs tags via webhook; check logs for
tagsAddconfirmationsReminder cron didn't run → check backend logs for
[scheduledJobs]+[reorderReminderJob]. Verify Mongo lock isn't stuck (look atLockcollection forreorder_reminder_daily)Email didn't arrive → check SMTP config + Settings → Email Settings → Send a test email. Check spam folder
Next
Last updated
Was this helpful?