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
tests[Op#52449]: use consistent test selectors for storage health
Kabiru Mwenjabf9437838c53
diff --git a/modules/storages/app/components/storages/admin/sidebar/health_status_component.html.erb b/modules/storages/app/components/storages/admin/sidebar/health_status_component.html.erbindex 6f51e23d39a..9504c12bc09 100644--- a/modules/storages/app/components/storages/admin/sidebar/health_status_component.html.erb+++ b/modules/storages/app/components/storages/admin/sidebar/health_status_component.html.erb@@ -16,18 +16,18 @@health_status_container.with_row(mt: 2) doflex_layout do |health_status_label|health_status_label.with_row do- concat(render(Primer::Beta::Text.new(pr: 2)) do+ concat(render(Primer::Beta::Text.new(pr: 2, test_selector: "storage-health-checked-at")) doI18n.t('storages.health.checked', datetime: helpers.format_time(@storage.health_checked_at))end)- concat(render(Primer::Beta::Label.new(scheme: health_status_indicator[:scheme])) do+ concat(render(Primer::Beta::Label.new(scheme: health_status_indicator[:scheme], test_selector: "storage-health-status")) dohealth_status_indicator[:label]end)endif @storage.health_unhealthy?health_status_label.with_row(mt: 2) do- render(Primer::Beta::Text.new(color: :muted)) do+ render(Primer::Beta::Text.new(color: :muted, test_selector: "storage-health-error")) doformatted_health_reasonendenddiff --git a/modules/storages/spec/components/storages/admin/sidebar/health_status_component_spec.rb b/modules/storages/spec/components/storages/admin/sidebar/health_status_component_spec.rbindex d91cf6cbad5..7a371df9eaa 100644--- a/modules/storages/spec/components/storages/admin/sidebar/health_status_component_spec.rb+++ b/modules/storages/spec/components/storages/admin/sidebar/health_status_component_spec.rb@@ -47,7 +47,7 @@ RSpec.describe Storages::Admin::Sidebar::HealthStatusComponent, type: :componentendit "shows a healthy status" do- expect(page).to have_test_selector("storage-health-label-healthy", text: "Healthy")+ expect(page).to have_test_selector("storage-health-status", text: "Healthy")expect(page).to have_test_selector("storage-health-checked-at", text: "Last checked 11/28/2023 01:02 AM")endend@@ -60,7 +60,7 @@ RSpec.describe Storages::Admin::Sidebar::HealthStatusComponent, type: :componentendit "shows pending label" do- expect(page).to have_test_selector("storage-health-label-pending", text: "Pending")+ expect(page).to have_test_selector("storage-health-status", text: "Pending")endend@@ -72,8 +72,8 @@ RSpec.describe Storages::Admin::Sidebar::HealthStatusComponent, type: :componentendit "shows an error status" do- expect(page).to have_test_selector("storage-health-label-error", text: "Error")- expect(page).to have_test_selector("storage-health-reason", text: "Error code: description since 11/28/2023 01:02 AM")+ expect(page).to have_test_selector("storage-health-status", text: "Error")+ expect(page).to have_test_selector("storage-health-error", text: "Error code: description since 11/28/2023 01:02 AM")endend@@ -85,8 +85,8 @@ RSpec.describe Storages::Admin::Sidebar::HealthStatusComponent, type: :componentendit "shows a formatted error reason" do- expect(page).to have_test_selector("storage-health-label-error", text: "Error")- expect(page).to have_test_selector("storage-health-reason",+ expect(page).to have_test_selector("storage-health-status", text: "Error")+ expect(page).to have_test_selector("storage-health-error",text: "Unauthorized: Outbound request not authorized since 11/28/2023 01:02 AM")endenddiff --git a/modules/storages/spec/features/storages/admin/edit_storage_spec.rb b/modules/storages/spec/features/storages/admin/edit_storage_spec.rbindex bbe471e671a..4bca4388f26 100644--- a/modules/storages/spec/features/storages/admin/edit_storage_spec.rb+++ b/modules/storages/spec/features/storages/admin/edit_storage_spec.rb@@ -223,7 +223,7 @@ RSpec.describe "Admin Edit File storage",it "renders health status information" dovisit edit_admin_settings_storage_path(storage)- expect(page).to have_test_selector("storage-health-label-pending", text: "Pending")+ expect(page).to have_test_selector("storage-health-status", text: "Pending")endend@@ -233,7 +233,7 @@ RSpec.describe "Admin Edit File storage",it "does not render health status information" dovisit edit_admin_settings_storage_path(storage)- expect(page).not_to have_test_selector("storage-health-label-pending", text: "Pending")+ expect(page).not_to have_test_selector("storage-health-status", text: "Pending")endend@@ -330,7 +330,7 @@ RSpec.describe "Admin Edit File storage",it "renders health status information" dovisit edit_admin_settings_storage_path(storage)- expect(page).to have_test_selector("storage-health-label-pending", text: "Pending")+ expect(page).to have_test_selector("storage-health-status", text: "Pending")endend@@ -340,7 +340,7 @@ RSpec.describe "Admin Edit File storage",it "does not render health status information" dovisit edit_admin_settings_storage_path(storage)- expect(page).not_to have_test_selector("storage-health-label-pending", text: "Pending")+ expect(page).not_to have_test_selector("storage-health-status", text: "Pending")endendend