mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #10448 from vviekk/viv/10009
Fixing Enterprise creation submit button behavior
This commit is contained in:
@@ -7,8 +7,12 @@ angular.module('Darkswarm').controller "RegistrationFormCtrl", ($scope, Registra
|
||||
form.$valid
|
||||
|
||||
$scope.create = (form) ->
|
||||
$scope.disableButton()
|
||||
EnterpriseRegistrationService.create($scope.enableButton) if $scope.valid(form)
|
||||
if ($scope.valid(form))
|
||||
$scope.disableButton()
|
||||
EnterpriseRegistrationService.create().then(() ->
|
||||
$scope.enableButton()
|
||||
)
|
||||
end
|
||||
|
||||
$scope.update = (nextStep, form) ->
|
||||
EnterpriseRegistrationService.update(nextStep) if $scope.valid(form)
|
||||
|
||||
@@ -70,6 +70,10 @@ describe "Registration", js: true do
|
||||
expect(page).to have_content 'Last step to add My Awesome Enterprise!'
|
||||
|
||||
# Choosing a type
|
||||
click_button "Create Profile"
|
||||
expect(page).to have_content("Please choose one. Are you are producer?")
|
||||
expect(page).to have_button "Create Profile", disabled: false
|
||||
|
||||
click_link "producer-panel"
|
||||
expect(page).to have_selector '#producer-panel.selected'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user