FIX: flaky system admin flags specs (#28873)

Recently `custom_` prefix was added for flags https://github.com/discourse/discourse/pull/28839

When we wait to ensure that `Tasteless` flag is deleted, we need to use new prefix as well.
This commit is contained in:
Krzysztof Kotlarek 2024-09-13 06:25:30 +10:00 committed by GitHub
parent 64b67e0a4f
commit 560b01f0cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -134,7 +134,7 @@ describe "Admin Flags Page", type: :system do
# delete
admin_flags_page.visit.click_delete_flag("custom_tasteless").confirm_delete
expect(admin_flags_page).to have_no_flag("tasteless")
expect(admin_flags_page).to have_no_flag("custom_tasteless")
expect(admin_flags_page).to have_add_flag_button_enabled
@ -157,6 +157,16 @@ describe "Admin Flags Page", type: :system do
.select_applies_to("Post")
.click_save
expect(admin_flags_page).to have_flags(
"Send @%{username} a message",
"Off-Topic",
"Inappropriate",
"Spam",
"Illegal",
"Something Else",
"Inappropriate",
)
topic_page.visit_topic(post.topic).open_flag_topic_modal
expect(flag_modal).to have_choices(
@ -166,7 +176,7 @@ describe "Admin Flags Page", type: :system do
"Inappropriate",
)
Flag.system.where(name: "illegal").update!(enabled: true)
Flag.system.where(name: "inappropriate").update!(enabled: true)
admin_flags_page.visit.click_delete_flag("custom_inappropriate").confirm_delete
end