OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
addings spec for after validation state of dialog
Jonas Jabari1bfadbc4893c
diff --git a/spec/features/projects/project_custom_fields/overview_page/dialog/validation_spec.rb b/spec/features/projects/project_custom_fields/overview_page/dialog/validation_spec.rbindex 3d8081008f5..c4d20d686bb 100644--- a/spec/features/projects/project_custom_fields/overview_page/dialog/validation_spec.rb+++ b/spec/features/projects/project_custom_fields/overview_page/dialog/validation_spec.rb@@ -40,6 +40,51 @@ RSpec.describe 'Edit project custom fields on project overview page', :js doenddescribe 'with correct validation behaviour' do+ describe 'after validation' do+ let(:section) { section_for_input_fields }+ let(:dialog) { Components::Projects::ProjectCustomFields::EditDialog.new(project, section) }++ it 'keeps showing only activated custom fields (tricky regression)' do+ custom_field = string_project_custom_field+ custom_field.update!(is_required: true)+ field = FormFields::Primerized::InputField.new(custom_field)++ overview_page.open_edit_dialog_for_section(section)++ dialog.within_async_content do+ containers = dialog.input_containers++ expect(containers[0].text).to include('Boolean field')+ expect(containers[1].text).to include('String field')+ expect(containers[2].text).to include('Integer field')+ expect(containers[3].text).to include('Float field')+ expect(containers[4].text).to include('Date field')+ expect(containers[5].text).to include('Text field')++ expect(page).to have_no_text(boolean_project_custom_field_activated_in_other_project.name)+ end++ field.fill_in(with: '') # this will trigger the validation++ dialog.submit++ field.expect_error(I18n.t('activerecord.errors.messages.blank'))++ dialog.within_async_content do+ containers = dialog.input_containers++ expect(containers[0].text).to include('Boolean field')+ expect(containers[1].text).to include('String field')+ expect(containers[2].text).to include('Integer field')+ expect(containers[3].text).to include('Float field')+ expect(containers[4].text).to include('Date field')+ expect(containers[5].text).to include('Text field')++ expect(page).to have_no_text(boolean_project_custom_field_activated_in_other_project.name)+ end+ end+ end+describe 'with input fields' dolet(:section) { section_for_input_fields }let(:dialog) { Components::Projects::ProjectCustomFields::EditDialog.new(project, section) }diff --git a/spec/features/projects/project_custom_fields/overview_page/shared_context.rb b/spec/features/projects/project_custom_fields/overview_page/shared_context.rbindex 3c50c90a452..5cfb258b243 100644--- a/spec/features/projects/project_custom_fields/overview_page/shared_context.rb+++ b/spec/features/projects/project_custom_fields/overview_page/shared_context.rb@@ -224,4 +224,9 @@ RSpec.shared_context 'with seeded projects, members and project custom fields' dmulti_user_project_custom_field]end++ let!(:boolean_project_custom_field_activated_in_other_project) do+ create(:boolean_project_custom_field, projects: [other_project], name: 'Other Boolean field',+ project_custom_field_section: section_for_input_fields)+ endend