Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eliotjordan committed Feb 12, 2025
1 parent 6163e52 commit f89ece3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test/dpul_collections_web/live/search_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ defmodule DpulCollectionsWeb.SearchLiveTest do
# There should be a maximum of 5 thumbnails on the search results page
assert document |> Floki.find("#item-1 > div > img") |> Enum.count() == 5

# Odd numbered documents do not have a thumbnail id so the order of
# thumbnails should be the same as the image member order
# Odd numbered documents in test data do not have a thumbnail id
# so the order of thumbnails should be the same as the image member order
assert document
|> Floki.attribute("#item-1 > div > :first-child", "src") == [
"https://example.com/iiif/2/image1/square/350,350/0/default.jpg"
Expand All @@ -74,8 +74,8 @@ defmodule DpulCollectionsWeb.SearchLiveTest do
"https://example.com/iiif/2/image2/square/350,350/0/default.jpg"
]

# Enen numbered documents have a thumbnail id so the order of
# thumbnails should be different from the image member order
# Even numbered documents in test data have a thumbnail id so the order
# of thumbnails should be different from the image member order
assert document
|> Floki.attribute("#item-2 > div > :first-child", "src") == [
"https://example.com/iiif/2/image2/square/350,350/0/default.jpg"
Expand Down
5 changes: 4 additions & 1 deletion test/support/solr_test_support.ex
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@ defmodule SolrTestSupport do
def mock_solr_documents(count \\ 100) do
for n <- 1..count do
date = 2025 - n

# Equals the number of image service urls
page_count = 7

# Assign thumbnail urls to even numbered documents
# Assign thumbnail urls to even numbered documents.
# Used for testing thumbnail rendering order
thumbnail_url =
cond do
rem(n, 2) == 0 -> "https://example.com/iiif/2/image2"
Expand Down

0 comments on commit f89ece3

Please sign in to comment.