From c0abaa89a3f637a35ede479923f6f8ceffa1028f Mon Sep 17 00:00:00 2001 From: c4710n Date: Tue, 9 Jan 2024 15:17:36 +0800 Subject: [PATCH] test: fix broken test randomly --- lib/cozy_svg.ex | 2 +- test/cozy_svg_test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cozy_svg.ex b/lib/cozy_svg.ex index e1076c4..c937637 100644 --- a/lib/cozy_svg.ex +++ b/lib/cozy_svg.ex @@ -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 diff --git a/test/cozy_svg_test.exs b/test/cozy_svg_test.exs index 0f3a69d..fbff410 100644 --- a/test/cozy_svg_test.exs +++ b/test/cozy_svg_test.exs @@ -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, "