Skip to content

Commit

Permalink
Remove classes that were only used for testing purposes and not for s…
Browse files Browse the repository at this point in the history
…tyling
  • Loading branch information
HDinger committed Aug 28, 2024
1 parent d08521d commit b0e8b11
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/components/primer/beta/link.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<%= render Primer::ConditionalWrapper.new(condition: tooltip?, trim: true, tag: :span, position: :relative) do %>
<%= render(Primer::BaseComponent.new(trim: true, **@system_arguments)) do %>
<% if leading_visual %>
<span class="Link-visual Link-leadingVisual">
<span>
<%= leading_visual %>
</span>
<% end %>
<%= content %>
<% if trailing_visual %>
<span class="Link-visual Link-trailingVisual">
<span>
<%= trailing_visual %>
</span>
<% end %>
Expand Down
8 changes: 5 additions & 3 deletions test/components/beta/link_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,18 @@ def test_renders_leading_visual_icon
end

assert_selector("a[href='http://google.com']")
assert_selector(".Link-visual.Link-leadingVisual .octicon-plus")
assert_selector(".octicon-plus")
end

def test_renders_trailing_visual_icon
render_inline(Primer::Beta::Link.new(href: "http://google.com")) do |component|
component.with_trailing_visual_icon(icon: "plus")
component.with_leading_visual_icon(icon: "plus")
component.with_trailing_visual_icon(icon: "alert")
"content"
end

assert_selector("a[href='http://google.com']")
assert_selector(".Link-visual.Link-trailingVisual .octicon-plus")
assert_selector("a span:first-child .octicon-plus")
assert_selector("a span:nth-child(2) .octicon-alert")
end
end

0 comments on commit b0e8b11

Please sign in to comment.