discourse/spec
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
..
fabricators UX: Use a dropdown for SSL mode for group SMTP (#27932) 2024-07-18 10:33:14 +10:00
fixtures FEATURE: Allow oneboxing private GitHub repo URLs and add private indicator to HTML (#27947) 2024-07-19 12:21:45 +10:00
generator DEV: Silence the output of migration specs (#26365) 2024-03-26 11:32:44 +01:00
helpers DEV: update base url links to respect subfolder installs (#27740) 2024-07-09 12:42:38 +04:00
import_export DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
initializers DEV: Allow fab! without block (#24314) 2023-11-09 16:47:59 -06:00
integration DEV: Upgrade Rails to version 7.1 2024-07-04 10:58:21 +02:00
integrity FIX: Set sane default for `Net::HTTP` when processing a request (#28141) 2024-08-06 07:12:42 +08:00
jobs DEV: refactor live notifications setting in user preferences (#28145) 2024-08-02 17:25:15 +04:00
lib DEV: Extend /filter's ability to order (#28242) 2024-08-07 16:37:00 +08:00
mailers UX: Use a dropdown for SSL mode for group SMTP (#27932) 2024-07-18 10:33:14 +10:00
migrations DEV: Remove invalid content_security_policy_script_src site setting values from DB (#27588) 2024-06-27 22:17:56 +08:00
models FEATURE: Add option to immediately delete stub topics upon merge (#28228) 2024-08-07 10:05:40 -03:00
multisite Revert "FIX: Cache all flags multisite-safe (#28204)" (#28236) 2024-08-06 10:59:10 +10:00
requests FIX: Unescape URI properly when redirecting to a category 2024-08-07 15:53:21 +02:00
script/import_scripts DEV: Catch missing translations during test runs (#26258) 2024-05-24 22:15:53 +08:00
serializers FIX: Return properly interpolated translations for flag types 2024-07-30 18:30:57 +02:00
services FIX: Don't clear inline problems when loading admin dashboard (#28220) 2024-08-05 11:45:55 +08:00
support DEV: Skip flaky topic map spec on CI (#28159) 2024-07-31 13:04:05 +10:00
system FIX: flaky flags specs when moving up or down (#28272) 2024-08-08 09:50:28 +08:00
tasks DEV: Stop storing theme-transpiler on filesystem in development (#28198) 2024-08-01 17:59:34 +01:00
views FEATURE: Simplify crawler content for non-canonical post URLs (#26324) 2024-03-26 15:18:46 +00:00
rails_helper.rb DEV: Use rspec mocks to properly verify a race condition 2024-08-06 15:57:04 +02:00
regenerate_swagger_docs DEV: Add API docs for uploads and API doc watcher (#15387) 2021-12-23 08:40:15 +10:00
swagger_helper.rb DEV: Bump rswag-specs from 2.11.0 to 2.13.0 (#24654) 2023-12-07 08:16:47 +08:00