Extend "Reset to defaults" to reset attribute visibility, too.

pull/5212/head
Wieland Lindenthal 8 years ago committed by Oliver Günther
parent 9378d42306
commit de35dfb2eb
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 1
      frontend/app/components/types/form-configuration/types-form-configuration.controller.ts
  2. 5
      spec/features/types/form_configuration_spec.rb

@ -49,6 +49,7 @@ function typesFormConfigurationCtrl(
$scope.resetToDefault = ($event: any): void => { $scope.resetToDefault = ($event: any): void => {
let form: JQuery = angular.element($event.target).parents('form'); let form: JQuery = angular.element($event.target).parents('form');
angular.element('input#type_attribute_groups').first().val(JSON.stringify([])); angular.element('input#type_attribute_groups').first().val(JSON.stringify([]));
angular.element('input#type_attribute_visibility').first().val(JSON.stringify({}));
form.submit(); form.submit();
}; };

@ -136,10 +136,14 @@ describe 'form configuration', type: :feature, js: true do
it 'resets the form properly after changes' do it 'resets the form properly after changes' do
rename_group('Details', 'Whatever') rename_group('Details', 'Whatever')
set_visibility(:assignee, checked: true)
expect_attribute(key: :assignee, checked: true)
reset_button.click reset_button.click
expect(page).to have_no_selector(group_selector('Whatever')) expect(page).to have_no_selector(group_selector('Whatever'))
expect_group('Details') expect_group('Details')
expect_attribute(key: :assignee, checked: false)
end end
it 'detects errors for duplicate group names' do it 'detects errors for duplicate group names' do
@ -267,4 +271,3 @@ describe 'form configuration', type: :feature, js: true do
loading_indicator_saveguard loading_indicator_saveguard
end end
end end

Loading…
Cancel
Save