Merge pull request #10448 from vviekk/viv/10009

Fixing Enterprise creation submit button behavior
This commit is contained in:
Filipe
2023-02-23 16:00:53 +00:00
committed by GitHub
2 changed files with 10 additions and 2 deletions

View File

@@ -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)

View File

@@ -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'