From 3b0a373de0f0fc5da8a1226a559a00129c4cff82 Mon Sep 17 00:00:00 2001 From: Romit Choudhary Date: Thu, 9 Sep 2021 14:40:53 +0200 Subject: [PATCH] Fixes #3271 - AttributeManager doesn't display boolean default values within the UI --- .../object_manager/attribute/boolean.jst.eco | 4 ++-- spec/system/system/object_manager_spec.rb | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/app/views/object_manager/attribute/boolean.jst.eco b/app/assets/javascripts/app/views/object_manager/attribute/boolean.jst.eco index 9b9bcef84..51408ec45 100644 --- a/app/assets/javascripts/app/views/object_manager/attribute/boolean.jst.eco +++ b/app/assets/javascripts/app/views/object_manager/attribute/boolean.jst.eco @@ -13,14 +13,14 @@ - checked<% end %>/> + checked<% end %>/> false - checked<% end %>/> + checked<% end %>/> diff --git a/spec/system/system/object_manager_spec.rb b/spec/system/system/object_manager_spec.rb index 4d973aed7..3bd5c1fa8 100644 --- a/spec/system/system/object_manager_spec.rb +++ b/spec/system/system/object_manager_spec.rb @@ -114,6 +114,24 @@ RSpec.describe 'Admin Panel > Objects', type: :system do expect(ObjectManager::Attribute.last.data_option['options']).to eq(expected_data_options) end + it 'checks default boolean value visibility' do + page.find('.js-new').click + + fill_in 'Name', with: 'bool1' + find('input[name=display]').set('Bool 1') + + page.find('select[name=data_type]').select('Boolean') + choose('data_option::default', option: 'true') + page.find('.js-submit').click + + td = page.find(:css, 'td', text: 'bool1') + tr = td.find(:xpath, './parent::tr') + + tr.click + + expect(page).to have_checked_field('data_option::default', with: 'true') + end + # https://github.com/zammad/zammad/issues/3647 context 'when setting Min/Max values for integer' do before do