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
add tests for new validation
Klaus Zanders02ef968cb10b
diff --git a/modules/my_page/spec/features/my/time_entries_current_user_spec.rb b/modules/my_page/spec/features/my/time_entries_current_user_spec.rbindex d665a26664b..856eab93885 100644--- a/modules/my_page/spec/features/my/time_entries_current_user_spec.rb+++ b/modules/my_page/spec/features/my/time_entries_current_user_spec.rb@@ -349,4 +349,22 @@ RSpec.describe "My page time entries current user widget spec", :js, :selenium d.to have_css(".grid--widget-add")endend++ it "validates that a work package is set" do+ my_page.add_widget(1, 1, :within, "My spent time")+ entries_area = Components::Grids::GridArea.new(".grid--area.-widgeted:nth-of-type(1)")+ my_page.expect_and_dismiss_toaster message: I18n.t(:notice_successful_update)++ within entries_area.area do+ find("td.fc-timegrid-col:nth-of-type(5) .te-calendar--add-entry", visible: false).click+ end++ time_logging_modal.is_visible true+ time_logging_modal.update_field "hours", 6++ time_logging_modal.submit++ time_logging_modal.is_visible true+ time_logging_modal.field_has_error "work_package_id", "can't be blank."+ endenddiff --git a/spec/features/support/components/time_logging_modal.rb b/spec/features/support/components/time_logging_modal.rbindex 3aeea699214..130f8fd653c 100644--- a/spec/features/support/components/time_logging_modal.rb+++ b/spec/features/support/components/time_logging_modal.rb@@ -118,6 +118,12 @@ module Componentsendend+ def field_has_error(field, error)+ within modal_container do+ expect(page).to have_css(".FormControl:has(label[for=time_entry_#{field}]) > .FormControl-inlineValidation", text: error)+ end+ end+def update_time_field(field_name, hour:, minute:)built_time = browser_timezone.local(2025, 1, 1, hour, minute, 0)page.fill_in "time_entry_#{field_name}", with: built_time.iso8601