Skip to content

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

attempt to fix flickerings spec

ulfertsc391763c5627
diff --git a/spec/features/work_packages/table/queries/filter_spec.rb b/spec/features/work_packages/table/queries/filter_spec.rb
index 0af9362be36..615487aeb44 100644
--- a/spec/features/work_packages/table/queries/filter_spec.rb
+++ b/spec/features/work_packages/table/queries/filter_spec.rb
@@ -576,8 +576,13 @@ RSpec.describe 'filter work packages', js: true do
last_query = Query.where(name: 'Some query name').first
date_filter = last_query.filters.last
- expect(date_filter.values)
- .to eq [4.days.ago.utc.beginning_of_day.iso8601, 2.days.ago.utc.end_of_day.iso8601]
+
+ # The frontend sends the date as a datetime string in utc where both bounds have the local offset deduced
+ # e.g. ["2023-05-31T22:00:00Z", "2023-06-03T21:59:59Z"]
+ Time.use_zone(ActiveSupport::TimeZone[Time.now.getlocal.zone]) do
+ expect(date_filter.values)
+ .to eq [(Time.now.getlocal - 4.days).beginning_of_day.utc.iso8601, (Time.now.getlocal - 2.days).end_of_day.utc.iso8601]
+ end
wp_table.visit_query(last_query)