Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

fix test (#4038)

RobertJoonas726fe2d98244
diff --git a/test/plausible_web/controllers/api/stats_controller/suggestions_test.exs b/test/plausible_web/controllers/api/stats_controller/suggestions_test.exs
index 8017a534b0..fd77e5279d 100644
--- a/test/plausible_web/controllers/api/stats_controller/suggestions_test.exs
+++ b/test/plausible_web/controllers/api/stats_controller/suggestions_test.exs
@@ -311,12 +311,15 @@ defmodule PlausibleWeb.Api.StatsController.SuggestionsTest do
"/api/stats/#{site.domain}/suggestions/hostname?q=host"
)
- assert json_response(conn, 200) ==
- [
- %{"label" => "host-alice.example.com", "value" => "host-alice.example.com"},
- %{"label" => "host-carol.example.com", "value" => "host-carol.example.com"},
- %{"label" => "host-bob.example.com", "value" => "host-bob.example.com"}
- ]
+ results = json_response(conn, 200)
+
+ assert length(results) == 3
+
+ assert %{"label" => "host-alice.example.com", "value" => "host-alice.example.com"} in results
+
+ assert %{"label" => "host-carol.example.com", "value" => "host-carol.example.com"} in results
+
+ assert %{"label" => "host-bob.example.com", "value" => "host-bob.example.com"} in results
conn =
get(