Skip to content

Commit

Permalink
test: fix broken test randomly
Browse files Browse the repository at this point in the history
  • Loading branch information
c4710n committed Jan 9, 2024
1 parent 6891b18 commit c0abaa8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/cozy_svg.ex
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ defmodule CozySVG do
end

def render(%{} = library, key, attrs) when is_map(attrs) do
attrs = Map.to_list(attrs)
attrs = attrs |> Map.to_list() |> Enum.sort_by(&elem(&1, 0))
render(library, key, attrs)
end

Expand Down
2 changes: 1 addition & 1 deletion test/cozy_svg_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ defmodule CozySVGTest do

test "inserts attributes as a map" do
svg = CozySVG.render(library(), "x", %{class: "test_class", "@click": "action"})
assert String.starts_with?(svg, "<svg class=\"test_class\" @click=\"action\" xmlns=")
assert String.starts_with?(svg, "<svg @click=\"action\" class=\"test_class\" xmlns=")
end

test "converts _ in attr name into -" do
Expand Down

0 comments on commit c0abaa8

Please sign in to comment.