FIX: missing flag serializer (#27683)

FlagSerializer is using in this PR
https://github.com/discourse/discourse/pull/27484 but was not staged.
This commit is contained in:
Krzysztof Kotlarek 2024-07-03 09:46:53 +10:00 committed by GitHub
parent c3fadc7330
commit 57af5d6f0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# frozen_string_literal: true
class FlagSerializer < ApplicationSerializer
attributes :id, :name, :name_key, :description, :applies_to, :position, :enabled
end

View File

@ -75,6 +75,18 @@ describe "Admin Flags Page", type: :system do
admin_flag_form_page.fill_in_applies_to("Post")
admin_flag_form_page.click_save
expect(all(".admin-flag-item__name").map(&:text)).to eq(
[
"Send @%{username} a message",
"Off-Topic",
"Inappropriate",
"Spam",
"Illegal",
"Something Else",
"Vulgar",
],
)
topic_page.visit_topic(post.topic)
topic_page.open_flag_topic_modal
expect(all(".flag-action-type-details strong").map(&:text)).to eq(