discourse/app
Krzysztof Kotlarek db4395d70c
FIX: flaky flags specs when moving up or down (#28272)
Those are the steps to move the flag:
1. open menu;
2. click move up - `saving` CSS class is added;
3. request to backend;
4. `saving` CSS class is removed.

To check if the action was finished we are using this method:
```
def move_up(key)
  open_flag_menu(key)
  find(".admin-flag-item__move-up").click
  has_saved_flag?(key)
  self
end

def has_saved_flag?(key)
  has_css?(".admin-flag-item.#{key}.saving")
  has_no_css?(".admin-flag-item.#{key}.saving")
end
```

However, sometimes specs were failing with `expected to find CSS ".admin-flag-item.spam.saving" but there were no matches`

I think that the problem is with those 2 lines:
```
  find(".admin-flag-item__move-up").click
  has_closed_flag_menu?
```
If the save action is very fast, then the `saving` class is removed before the first check.

Therefore, to determine that the move action is finished, I am checking if the menu is closed.
2024-08-08 09:50:28 +08:00
..
assets FIX: flaky flags specs when moving up or down (#28272) 2024-08-08 09:50:28 +08:00
controllers FIX: Unescape URI properly when redirecting to a category 2024-08-07 15:53:21 +02:00
helpers UX: Use localized time format in embedded comments (#28014) 2024-07-22 18:42:36 +08:00
jobs FEATURE: Add live_slots_(start|finish) for Sidekiq perf logging (#28260) 2024-08-07 15:48:24 +08:00
mailers UX: Use a dropdown for SSL mode for group SMTP (#27932) 2024-07-18 10:33:14 +10:00
models FEATURE: Add option to immediately delete stub topics upon merge (#28228) 2024-08-07 10:05:40 -03:00
serializers DEV: Add site age and site activities section to the redesigned about page (#28214) 2024-08-07 11:11:41 +03:00
services FIX: Don't clear inline problems when loading admin dashboard (#28220) 2024-08-05 11:45:55 +08:00
views FIX: Exclude reply count on posts due to required Comment nesting (#27892) 2024-07-15 09:40:47 +08:00