UX: Add required indicator to fields with required validation (#22096)

This commit is contained in:
Keegan George
2023-06-14 11:25:05 -07:00
committed by GitHub
parent 6084b331ed
commit 9dc63c0755
9 changed files with 53 additions and 6 deletions

View File

@@ -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

View File

@@ -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?