Skip to content

Commit

Permalink
Default to full aspect thumbnail
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Sep 26, 2022
1 parent 076d59f commit 9388068
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/handlers/get-work-thumbnail.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function getAxiosResponse(url, config) {

function validateRequest(event) {
const id = event.pathParameters.id;
const aspect = event?.queryStringParameters?.aspect || "square";
const aspect = event?.queryStringParameters?.aspect || "full";
const sizeParam = event?.queryStringParameters?.size || 300;
const size = Number(sizeParam);

Expand Down
10 changes: 5 additions & 5 deletions test/integration/get-thumbnail.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ describe("Work thumbnail", () => {
.get("/dc-v2-work/_doc/1234")
.reply(200, helpers.testFixture("mocks/work-1234.json"));
mock
.get("/iiif/2/mbk-dev/5678/square/!300,300/0/default.jpg")
.reply(200, helpers.testFixture("mocks/thumbnail_square.jpg"), {
.get("/iiif/2/mbk-dev/5678/full/!300,300/0/default.jpg")
.reply(200, helpers.testFixture("mocks/thumbnail_full.jpg"), {
"Content-Type": "image/jpeg",
});

Expand All @@ -36,7 +36,7 @@ describe("Work thumbnail", () => {
.get("/dc-v2-work/_doc/1234")
.reply(200, helpers.testFixture("mocks/work-1234.json"));
mock
.get("/iiif/2/mbk-dev/5678/square/!300,300/0/default.jpg")
.get("/iiif/2/mbk-dev/5678/full/!300,300/0/default.jpg")
.reply(403, "Forbidden", { "Content-Type": "text/plain" });

const result = await handler(event.render());
Expand Down Expand Up @@ -67,8 +67,8 @@ describe("Work thumbnail", () => {
.get("/dc-v2-work/_doc/1234")
.reply(200, helpers.testFixture("mocks/work-1234.json"));
mock
.get("/iiif/2/mbk-dev/5678/square/!200,200/0/default.jpg")
.reply(200, helpers.testFixture("mocks/thumbnail_square.jpg"), {
.get("/iiif/2/mbk-dev/5678/full/!200,200/0/default.jpg")
.reply(200, helpers.testFixture("mocks/thumbnail_full.jpg"), {
"Content-Type": "image/jpeg",
});

Expand Down

0 comments on commit 9388068

Please sign in to comment.