Do not assume any order in browser data import test

This commit is contained in:
Adam Rutkowski 2022-09-05 11:51:50 +02:00
parent b9ae568bad
commit 79b4550bed

View File

@ -846,11 +846,11 @@ defmodule Plausible.ImportedTest do
"/api/stats/#{site.domain}/browsers?period=day&date=2021-01-01&with_imported=true"
)
assert json_response(conn, 200) == [
%{"name" => "Firefox", "visitors" => 2, "percentage" => 50},
%{"name" => "Mobile App", "visitors" => 1, "percentage" => 25},
%{"name" => "Chrome", "visitors" => 1, "percentage" => 25}
]
assert stats = json_response(conn, 200)
assert length(stats) == 3
assert %{"name" => "Firefox", "visitors" => 2, "percentage" => 50} in stats
assert %{"name" => "Mobile App", "visitors" => 1, "percentage" => 25} in stats
assert %{"name" => "Chrome", "visitors" => 1, "percentage" => 25} in stats
end
test "OS data imported from Google Analytics", %{conn: conn, site: site} do