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
Attempt fix for promotions date picker.
Matthew Kennedy08a69c484164
diff --git a/backend/spec/features/admin/promotions/promotion_spec.rb b/backend/spec/features/admin/promotions/promotion_spec.rbindex 31191975a2..8cdbcfed48 100644--- a/backend/spec/features/admin/promotions/promotion_spec.rb+++ b/backend/spec/features/admin/promotions/promotion_spec.rb@@ -19,10 +19,11 @@ describe 'Create New Promotion', type: :feature, js: true doendit 'Allows you to set a promotion with start and end time' do- fill_in 'Name', with: 'Promotion 2'- fill_in 'Code', with: 'Random 2323'fill_in_date_time_picker('promotion_starts_at', with: '2012-01-24-16-45')+ fill_in 'Name', with: 'Promotion 2'+fill_in_date_time_picker('promotion_expires_at', with: '2012-01-25-22-10')+ fill_in 'Code', with: 'Random 2323'click_button 'Create'diff --git a/core/lib/spree/testing_support/flatpickr_capybara.rb b/core/lib/spree/testing_support/flatpickr_capybara.rbindex ae0d0a8b35..4f6b6ea3b8 100644--- a/core/lib/spree/testing_support/flatpickr_capybara.rb+++ b/core/lib/spree/testing_support/flatpickr_capybara.rb@@ -57,18 +57,18 @@ module Spreedate_field.send_keys :tab # Close the date picker widgetend- def within_open_flatpickr(label_text)+ def within_open_flatpickr(label_text, &block)with_open_flatpickr(label_text) do- within find(:xpath, "/html/body/div[contains(@class, 'flatpickr-calendar')]") { yield }+ within find(:xpath, "/html/body/div[contains(@class, 'flatpickr-calendar')]", &block)endend- def within_flatpickr_months- within find('.flatpickr-months .flatpickr-month .flatpickr-current-month') { yield }+ def within_flatpickr_months(&block)+ within find('.flatpickr-months .flatpickr-month .flatpickr-current-month', &block)end- def within_flatpickr_time- within find('.flatpickr-time') { yield }+ def within_flatpickr_time(&block)+ within find('.flatpickr-time', &block)enddef select_flatpickr_month(month)@@ -85,8 +85,8 @@ module Spreeendend- def within_flatpickr_days- within find('.flatpickr-innerContainer > .flatpickr-rContainer > .flatpickr-days') { yield }+ def within_flatpickr_days(&block)+ within find('.flatpickr-innerContainer > .flatpickr-rContainer > .flatpickr-days', &block)enddef select_flatpickr_hour(hour)