From e3db4e2e866025d167485566175f653dd1aa4119 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Thu, 21 Jan 2021 15:19:45 +0100 Subject: [PATCH] update test to match new datepicker And use the method choose_today_from_datepicker --- spec/features/admin/subscriptions_spec.rb | 4 +--- spec/support/features/datepicker_helper.rb | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/spec/features/admin/subscriptions_spec.rb b/spec/features/admin/subscriptions_spec.rb index af9c7b8eaa..0b73748b97 100644 --- a/spec/features/admin/subscriptions_spec.rb +++ b/spec/features/admin/subscriptions_spec.rb @@ -195,9 +195,7 @@ feature 'Subscriptions' do expect(page).to have_content 'can\'t be blank', count: 1 expect(page).to have_content 'Oops! Please fill in all of the required fields...' find_field('begins_at').click - within(".ui-datepicker-calendar") do - find('.ui-datepicker-today').click - end + choose_today_from_datepicker click_button('Next') expect(page).to have_content 'BILLING ADDRESS' diff --git a/spec/support/features/datepicker_helper.rb b/spec/support/features/datepicker_helper.rb index 9c8b6adc63..afeef2a046 100644 --- a/spec/support/features/datepicker_helper.rb +++ b/spec/support/features/datepicker_helper.rb @@ -3,8 +3,8 @@ module Features module DatepickerHelper def choose_today_from_datepicker - within(".ui-datepicker-calendar") do - find(".ui-datepicker-today").click + within(".flatpickr-calendar.open") do + find('.shortcut-buttons-flatpickr-button').click end end