Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix flaky work package table widget spec on my page
Problem
work_package_table_spec.rb:79was intermittently failing after a page reload with:expected not to find visible css ".subject" with text "WorkPackage No. 24", found 3 matches
The table rendered in its default (unfiltered, all-columns) state instead of the saved filter + column configuration.
Root cause
WidgetWpTableComponentauto-saves the query via an RxJS subscription onquerySpace.query.values$()with askip(2)guard. When the column configuration modal is closed (Apply clicked), the save is triggered through a reactive chain:This chain involves enough async hops that
wait_for_network_idlecalled immediately after the click could fire during a brief window before the PATCH request was initiated — the network was already idle at that point, so Ferrum returned prematurely and the browser navigated away before the save completed.On reload the server returned the original, unsaved query, causing both the filter and column changes to appear missing.
Fix
Two ordering changes to the spec:
Before the reload — move
wait_for_network_idleto after the DOM assertions that confirm the column removal.have_no_css(".subject", ...)forces Capybara to retry until Angular has updated the DOM, which guarantees the RxJS chain has fired and the PATCH is in-flight. Only then doeswait_for_network_idleconfirm the request completed.After the reload — move the widget title assertion (
have_field("editable-toolbar-title", with: "My WP Filter", wait: 10)) to before the negative assertions. The title comes from the grid API; waiting for it to appear confirms the widget is initialized from persisted state. A secondwait_for_network_idlethen catches the subsequent query and results fetches before any negative assertions run.