has_element?(
- "img[src='https://example.com/iiif/2/image2/full/350,465/0/default.jpg']"
+ ".primary-thumbnail img[src='https://example.com/iiif/2/image1/full/525,800/0/default.jpg']"
)
# Renders when there's no description
From d09e7d6079b81da3cdad2988b6818543fd188a87 Mon Sep 17 00:00:00 2001
From: Anna Headley <845363+hackartisan@users.noreply.github.com>
Date: Mon, 6 Jan 2025 11:31:31 -0500
Subject: [PATCH 2/2] Add a pdf download link
closes #257
---
config/config.exs | 2 ++
config/test.exs | 2 ++
lib/dpul_collections_web/live/item_live.ex | 7 ++++++-
test/dpul_collections_web/live/item_live_test.exs | 6 ++++++
4 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/config/config.exs b/config/config.exs
index 85de92d5..a97fac0f 100644
--- a/config/config.exs
+++ b/config/config.exs
@@ -67,6 +67,8 @@ config :dpul_collections, DpulCollectionsWeb.Gettext,
default_locale: "en",
locales: ~w(en es)
+config :dpul_collections, :web_connections, figgy_url: "https://figgy.princeton.edu"
+
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{config_env()}.exs"
diff --git a/config/test.exs b/config/test.exs
index 30c6d7ba..4a4d04e4 100644
--- a/config/test.exs
+++ b/config/test.exs
@@ -69,3 +69,5 @@ config :dpul_collections, :solr, %{
# Set this poll interval really small so it triggers in test.
config :dpul_collections, :figgy_hydrator, poll_interval: 50
+
+config :dpul_collections, :web_connections, figgy_url: "https://figgy.example.com"
diff --git a/lib/dpul_collections_web/live/item_live.ex b/lib/dpul_collections_web/live/item_live.ex
index 4b888c96..d67fbc79 100644
--- a/lib/dpul_collections_web/live/item_live.ex
+++ b/lib/dpul_collections_web/live/item_live.ex
@@ -51,7 +51,12 @@ defmodule DpulCollectionsWeb.ItemLive do
height="800"
/>
diff --git a/test/dpul_collections_web/live/item_live_test.exs b/test/dpul_collections_web/live/item_live_test.exs
index b4262963..76f3908e 100644
--- a/test/dpul_collections_web/live/item_live_test.exs
+++ b/test/dpul_collections_web/live/item_live_test.exs
@@ -119,6 +119,12 @@ defmodule DpulCollectionsWeb.ItemLiveTest do
".primary-thumbnail img[src='https://example.com/iiif/2/image1/full/525,800/0/default.jpg']"
)
+ assert view
+ |> has_element?(
+ ".primary-thumbnail a[href='https://figgy.example.com/catalog/1/pdf']",
+ "Download PDF"
+ )
+
# Renders when there's no description
{:ok, view, _html} = live(conn, "/i/زلزلہ/item/2")
response = render(view)