discourse/spec/system/page_objects
Krzysztof Kotlarek 56524f4bdf
DEV: flaky toggle flag spec (#28292)
Very similar to move up/down flag problem fixed here -  https://github.com/discourse/discourse/pull/28272

Those are the steps to toggle the flag:
1. click toggle - `saving` CSS class is added;
2. request to backend;
3. `saving` CSS class is removed.

And check if the flag was toggle was:
```ruby
def has_saved_flag?(key)
  has_css?(".admin-flag-item.#{key}.saving")
  has_no_css?(".admin-flag-item.#{key}.saving")
end
```
If the save action is very fast, then the saving class is removed before the first check.

Therefore I decided to invert it, and once action is finished add `saved` CSS class.

Then we can have a quick positive check:

```ruby
def has_saved_flag?(key)
  has_css?(".admin-flag-item.#{key}.saved")
end
```
2024-08-09 09:56:10 +10:00
..
components FEATURE: "Hot" replacing "Top" as default in the top menu (#28252) 2024-08-08 13:57:42 -04:00
modals UX: move admin flag form to form-kit (#28187) 2024-08-05 11:01:25 +10:00
pages DEV: flaky toggle flag spec (#28292) 2024-08-09 09:56:10 +10:00
admin_badges.rb FIX: Badge image uploader (#28188) 2024-08-01 15:36:17 +02:00
admin_user_badges.rb DEV: lint against Layout/EmptyLineBetweenDefs (#24914) 2023-12-15 23:46:04 +08:00
cdp.rb DEV: Try until success for clipboard copies (#27986) 2024-07-19 19:44:10 +08:00