Fix flaky collection live index test
This commit is contained in:
@@ -158,7 +158,7 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
|
|||||||
end
|
end
|
||||||
|
|
||||||
test "supports filters", %{conn: conn, collection: records} do
|
test "supports filters", %{conn: conn, collection: records} do
|
||||||
{artist_with_most_records, _records_count} =
|
{artist_with_most_records, records_count} =
|
||||||
records
|
records
|
||||||
|> Enum.frequencies_by(fn r ->
|
|> Enum.frequencies_by(fn r ->
|
||||||
[artist] = r.artists
|
[artist] = r.artists
|
||||||
@@ -174,7 +174,9 @@ defmodule MusicLibraryWeb.CollectionLive.IndexTest do
|
|||||||
|
|
||||||
qs = [
|
qs = [
|
||||||
query: ~s(artist:"#{artist_with_most_records}"),
|
query: ~s(artist:"#{artist_with_most_records}"),
|
||||||
page_size: @default_records_page_size
|
# Sometimes we generate more reconrds than the default page size, so we
|
||||||
|
# need to make sure all of them are included in the results
|
||||||
|
page_size: max(@default_records_page_size, records_count)
|
||||||
]
|
]
|
||||||
|
|
||||||
session =
|
session =
|
||||||
|
|||||||
Reference in New Issue
Block a user