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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Update store selector feature test for new style store selector.
Matthew Kennedy22c35f5a5173
diff --git a/backend/app/helpers/spree/admin/stores_helper.rb b/backend/app/helpers/spree/admin/stores_helper.rbindex 4c050180a1..7a9eeda6c8 100644--- a/backend/app/helpers/spree/admin/stores_helper.rb+++ b/backend/app/helpers/spree/admin/stores_helper.rb@@ -23,7 +23,7 @@ module Spreeendlink_to icon + store.unique_name, store.formatted_url + request.path,- class: "#{classes} text-dark p-3 dropdown-item"+ class: "#{classes} text-dark p-3 dropdown-item", id: store.codeendendenddiff --git a/backend/spec/features/admin/store_selector_spec.rb b/backend/spec/features/admin/store_selector_spec.rbindex 59976d7889..e274e8955d 100644--- a/backend/spec/features/admin/store_selector_spec.rb+++ b/backend/spec/features/admin/store_selector_spec.rb@@ -1,19 +1,38 @@require 'spec_helper'-describe 'Admin store selector', type: :feature, js: true do+describe 'Admin store switcher', type: :feature, js: true dostub_authorization!let!(:admin_user) { create(:admin_user) }+ let!(:store_one) { Spree::Store.default }+ let!(:store_two) { create(:store, url: 'www.example-one.com') }+ let!(:store_three) { create(:store, url: 'www.example-two.com') }- let!(:store) { create(:store, url: "www.example1.com") }+ context 'on the orders page of admin' do+ before do+ visit spree.admin_path+ end- before do- visit spree.admin_path+ it 'allows to change the url to the seleted store and returns you to orders page' do+ find('a#storeSelectorDropdown').click++ expect(page).to have_selector(:css, "a[href='#{store_one.formatted_url}/admin/orders']")+ expect(page).to have_selector(:css, "a[href='#{store_two.formatted_url}/admin/orders']")+ expect(page).to have_selector(:css, "a[href='#{store_three.formatted_url}/admin/orders']")+ endend- it "should allow to change the url to the seleted store" do- expect(current_url).not_to include("#{store.formatted_url}")- find("select#store_select").find(:xpath, 'option[2]').select_option- expect(current_url).to eq "#{store.formatted_url}/admin"+ context 'on the products page of admin' do+ before do+ visit spree.admin_products_path+ end++ it 'allows to change the store store and returns you to products page' do+ find('a#storeSelectorDropdown').click++ expect(page).to have_selector(:css, "a[href='#{store_one.formatted_url}/admin/products']")+ expect(page).to have_selector(:css, "a[href='#{store_two.formatted_url}/admin/products']")+ expect(page).to have_selector(:css, "a[href='#{store_three.formatted_url}/admin/products']")+ endend-end\ No newline at end of file+end