mirror of
https://github.com/discourse/discourse.git
synced 2025-06-21 17:01:47 +08:00

Before this commit, `PageObjects::Components::SelectKit#expanded_component` might not expand the component if `is_collapsed?` returns true which can return true if the method was called before the select-kit component appears on the screen. When that happens, we end up not expanding the `select-kit` because we think it is collapsed when in fact the select-kit component is not rendered yet. This lead to system test failures with errors like: ``` Capybara::ElementNotFound: Unable to find css "#add-synonyms.is-expanded" ``` This commit updates `PageObjects::Components::SelectKit#is_collapsed?` to check that the select-kit component has rendered first before checking if the component is not expanded. ### Reviewer notes Instances of test flakiness due to this bug: 1. https://github.com/discourse/discourse/actions/runs/13905226478/job/38906569777 2. https://github.com/discourse/discourse/actions/runs/13848357836/job/38751122333