mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-28 01:53:25 +00:00
Copy datepicker directive to utils module
Ensures that datepicker is available for subscriptions
This commit is contained in:
committed by
Maikel Linke
parent
386716088a
commit
c77a01815c
@@ -0,0 +1,9 @@
|
||||
angular.module("admin.utils").directive "datepicker", ->
|
||||
require: "ngModel"
|
||||
link: (scope, element, attrs, ngModel) ->
|
||||
element.datepicker
|
||||
dateFormat: "yy-mm-dd"
|
||||
onSelect: (dateText, inst) ->
|
||||
scope.$apply (scope) ->
|
||||
# Fires ngModel.$parsers
|
||||
ngModel.$setViewValue dateText
|
||||
@@ -159,7 +159,10 @@ feature 'Subscriptions' do
|
||||
click_button('Next')
|
||||
expect(page).to have_content 'can\'t be blank', count: 2
|
||||
expect(page).to have_content 'Oops! Please fill in all of the required fields...'
|
||||
fill_in 'begins_at', with: Time.zone.today.strftime('%F')
|
||||
find_field('begins_at').click
|
||||
within(".ui-datepicker-calendar") do
|
||||
find('.ui-datepicker-today').click
|
||||
end
|
||||
select2_select card2_option, from: 'credit_card_id'
|
||||
|
||||
click_button('Next')
|
||||
|
||||
Reference in New Issue
Block a user