From c638e2e65ed4e1dc9c43dada8bd0d1536d0dc6c6 Mon Sep 17 00:00:00 2001 From: Ahmed Ejaz Date: Sun, 16 Nov 2025 17:00:00 +0500 Subject: [PATCH] Update specs to prioritize name order in case of on-demand products --- spec/system/admin/products_v3/index_spec.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spec/system/admin/products_v3/index_spec.rb b/spec/system/admin/products_v3/index_spec.rb index 130831ca66..ac56ec1cfb 100644 --- a/spec/system/admin/products_v3/index_spec.rb +++ b/spec/system/admin/products_v3/index_spec.rb @@ -181,7 +181,7 @@ RSpec.describe 'As an enterprise user, I can manage my products' do # product with multiple variants having one on-demand item product_d = create(:simple_product, name: "Dates") - product_d.variants.first.stock_items.update_all(count_on_hand: 1, backorderable: false) + product_d.variants.first.stock_items.update_all(count_on_hand: 100, backorderable: false) create(:variant, product: product_d, on_hand: 0, on_demand: true) within products_table do @@ -195,7 +195,8 @@ RSpec.describe 'As an enterprise user, I can manage my products' do # Sort in descending order on_hand_header.click expect(page).to have_content("On Hand ▼") # this indicates the re-sorted - expect(all_input_values).to match /Dates.*Bananas.*Cherries.*Apples/ + # For all on-demand products, alphabetical order is also applied + expect(all_input_values).to match /Bananas.*Dates.*Cherries.*Apples/ end end end