-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e6af8f
commit 2bc9dc6
Showing
4 changed files
with
104 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const nulLogo = { | ||
id: "https://iiif.dc.library.northwestern.edu/iiif/2/00000000-0000-0000-0000-000000000003/full/pct:50/0/default.webp", | ||
type: "Image", | ||
format: "image/webp", | ||
height: 139, | ||
width: 1190, | ||
}; | ||
|
||
const provider = { | ||
id: "https://www.library.northwestern.edu/", | ||
type: "Agent", | ||
label: { none: ["Northwestern University Libraries"] }, | ||
homepage: [ | ||
{ | ||
id: "https://dc.library.northwestern.edu/", | ||
type: "Text", | ||
label: { | ||
none: [ | ||
"Northwestern University Libraries Digital Collections Homepage", | ||
], | ||
}, | ||
format: "text/html", | ||
language: ["en"], | ||
}, | ||
], | ||
logo: [nulLogo], | ||
}; | ||
|
||
module.exports = { nulLogo, provider }; |
40 changes: 40 additions & 0 deletions
40
node/test/unit/api/response/iiif/presentation-api/provider.test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
"use strict"; | ||
|
||
const chai = require("chai"); | ||
const expect = chai.expect; | ||
|
||
const { provider, nulLogo } = requireSource( | ||
"api/response/iiif/presentation-api/provider" | ||
); | ||
|
||
describe("IIIF response presentation API provider and logo", () => { | ||
it("outputs a IIIF provider property", async () => { | ||
expect(provider.id).to.contain("https://www.library.northwestern.edu"); | ||
expect(provider.type).to.eq("Agent"); | ||
expect(provider.label.none[0]).to.eq("Northwestern University Libraries"); | ||
expect(provider.homepage[0].id).to.contain( | ||
"https://dc.library.northwestern.edu" | ||
); | ||
expect(provider.homepage[0].label.none[0]).to.eq( | ||
"Northwestern University Libraries Digital Collections Homepage" | ||
); | ||
expect(provider.logo).to.be.an("array"); | ||
expect(provider.logo[0].id).to.contain( | ||
"https://iiif.dc.library.northwestern.edu/iiif/2/00000000-0000-0000-0000-000000000003/full/pct:50/0/default.webp" | ||
); | ||
expect(provider.logo[0].type).to.eq("Image"); | ||
expect(provider.logo[0].format).to.eq("image/webp"); | ||
expect(provider.logo[0].height).to.be.a("number"); | ||
expect(provider.logo[0].width).to.be.a("number"); | ||
}); | ||
|
||
it("outputs a IIIF logo property", async () => { | ||
expect(nulLogo.id).to.contain( | ||
"https://iiif.dc.library.northwestern.edu/iiif/2/00000000-0000-0000-0000-000000000003/full/pct:50/0/default.webp" | ||
); | ||
expect(nulLogo.type).to.eq("Image"); | ||
expect(nulLogo.format).to.eq("image/webp"); | ||
expect(nulLogo.height).to.be.a("number"); | ||
expect(nulLogo.width).to.be.a("number"); | ||
}); | ||
}); |