mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Add required indicator to fields with required validation (#22096)
This commit is contained in:
@@ -68,6 +68,12 @@ describe "Composer Form Template Validations", type: :system, js: true do
|
||||
sign_in user
|
||||
end
|
||||
|
||||
it "shows an asterisk on the label of the required fields" do
|
||||
category_page.visit(category_with_template)
|
||||
category_page.new_topic_button.click
|
||||
expect(composer).to have_form_template_field_required_indicator("input")
|
||||
end
|
||||
|
||||
it "shows an error when a required input is not filled in" do
|
||||
category_page.visit(category_with_template)
|
||||
category_page.new_topic_button.click
|
||||
|
||||
@@ -142,6 +142,12 @@ module PageObjects
|
||||
page.has_css?(".form-template-field[data-field-type='#{field}']")
|
||||
end
|
||||
|
||||
def has_form_template_field_required_indicator?(field)
|
||||
page.has_css?(
|
||||
".form-template-field[data-field-type='#{field}'] .form-template-field__required-indicator",
|
||||
)
|
||||
end
|
||||
|
||||
FORM_TEMPLATE_CHOOSER_SELECTOR = ".composer-select-form-template"
|
||||
|
||||
def has_no_form_template_chooser?
|
||||
|
||||
Reference in New Issue
Block a user