Skip to content

Commit

Permalink
chore[Op#57579]: ensure subheader component is appropriately hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
akabiru committed Sep 6, 2024
1 parent 7344b21 commit a79e03a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ See COPYRIGHT and LICENSE files for more details.
%>

<%=
render(Primer::OpenProject::SubHeader.new) do |component|
render(Primer::OpenProject::SubHeader.new(test_selector: "add-projects-sub-header")) do |component|
component.with_action_component do
render(Primer::Beta::Button.new(
scheme: :primary,
Expand All @@ -47,7 +47,7 @@ See COPYRIGHT and LICENSE files for more details.
I18n.t(:label_add_projects)
end
end
end unless @custom_field.required?
end unless @custom_field.is_for_all?
%>

<%=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ See COPYRIGHT and LICENSE files for more details.
%>

<%=
render(Primer::OpenProject::SubHeader.new) do |component|
render(Primer::OpenProject::SubHeader.new(test_selector: "add-projects-sub-header")) do |component|
component.with_action_component do
render(Primer::Beta::Button.new(
scheme: :primary,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@

it "renders a blank slate" do
expect(page).to have_text("For all projects")
expect(page).not_to have_test_selector("add-projects-sub-header")
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@

it "renders a blank slate" do
expect(page).to have_text("Required in all projects")
expect(page).not_to have_test_selector("add-projects-sub-header")
end
end
end
Expand Down

0 comments on commit a79e03a

Please sign in to comment.