File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ def html_attributes
4343 def a11y
4444 accessible = { }
4545
46- if @options [ :' aria-label' ] . nil?
47- accessible [ :' aria-hidden' ] = "true"
46+ if @options [ :" aria-label" ] . nil? && @options [ "aria-label" ] . nil?
47+ accessible [ :" aria-hidden" ] = "true"
4848 else
4949 accessible [ :role ] = "img"
5050 end
Original file line number Diff line number Diff line change 9292 end
9393
9494 describe "a11y" do
95- it "includes attributes" do
95+ it "includes attributes for symbol keys " do
9696 icon = octicon ( "x" , "aria-label" : "Close" )
9797 assert_includes icon . to_svg , "role=\" img\" "
9898 assert_includes icon . to_svg , "aria-label=\" Close\" "
99+ refute_includes icon . to_svg , "aria-hidden"
100+ end
101+
102+ it "includes attributes for string keys" do
103+ icon = octicon ( "x" , "aria-label" => "Close" )
104+ assert_includes icon . to_svg , "role=\" img\" "
105+ assert_includes icon . to_svg , "aria-label=\" Close\" "
106+ refute_includes icon . to_svg , "aria-hidden"
99107 end
100108
101109 it "has aria-hidden when no label is passed in" do
You can’t perform that action at this time.
0 commit comments