mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 19:29:34 +08:00
UX: the ability to hide the admin header (#30175)
Some pages like new/edit item should not display admin header. New attribute called `@shouldDisplay` was added. As a proof of concept, the flags page was updated.
This commit is contained in:

committed by
GitHub

parent
d69edab611
commit
51a5fa036a
@ -6,9 +6,11 @@ describe "Admin User Fields", type: :system do
|
||||
before { sign_in(current_user) }
|
||||
|
||||
let(:user_fields_page) { PageObjects::Pages::AdminUserFields.new }
|
||||
let(:admin_header) { PageObjects::Components::AdminHeader.new }
|
||||
|
||||
it "correctly saves user fields" do
|
||||
user_fields_page.visit
|
||||
expect(admin_header).to be_visible
|
||||
user_fields_page.add_field(name: "Occupation", description: "What you do for work")
|
||||
|
||||
expect(user_fields_page).to have_user_field("Occupation")
|
||||
@ -30,6 +32,8 @@ describe "Admin User Fields", type: :system do
|
||||
user_fields_page.visit
|
||||
user_fields_page.click_add_field
|
||||
|
||||
expect(admin_header).to be_hidden
|
||||
|
||||
form = page.find(".user-field")
|
||||
editable_label = I18n.t("admin_js.admin.user_fields.editable.title")
|
||||
|
||||
@ -69,6 +73,8 @@ describe "Admin User Fields", type: :system do
|
||||
|
||||
form.find(".user-field-name").fill_in(with: "Favourite Transformer")
|
||||
|
||||
expect(admin_header).to be_hidden
|
||||
|
||||
form.find(".btn-primary").click
|
||||
|
||||
expect(page).to have_no_text(I18n.t("admin_js.admin.user_fields.requirement.confirmation"))
|
||||
|
Reference in New Issue
Block a user