From 42df4e0d8f2be7480db631a2740cba7921633dd0 Mon Sep 17 00:00:00 2001 From: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:30:30 +0200 Subject: [PATCH] fix test (#4038) --- .../api/stats_controller/suggestions_test.exs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 8017a534b07a8..fd77e5279d5a4 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(