Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test infrastructure to project. #48

Merged
merged 14 commits into from
Oct 24, 2024
1 change: 1 addition & 0 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ jobs:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm run build
- run: npm test
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
node-version: '18'
- run: npm ci
- run: npm run build
- run: npm test

release:
needs: [build]
Expand Down
366 changes: 366 additions & 0 deletions __tests__/fixtures/bl-av-auth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,366 @@
{
"@context": [
"http://iiif.io/api/auth/1/context.json",
"http://iiif.io/api/presentation/3/context.json"
],
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000002/manifest.json",
"type": "Manifest",
"label": {
"en": [
"George Evans / Basil Bunting"
]
},
"metadata": [
{
"label": {
"en": [
"Full title"
]
},
"value": {
"en": [
"George Evans / Basil Bunting"
]
}
},
{
"label": {
"en": [
"Collection"
]
},
"value": {
"en": [
"Robert Hampson tapes"
]
}
},
{
"label": {
"en": [
"Format"
]
},
"value": {
"en": [
"1 compact cassette"
]
}
},
{
"label": {
"en": [
"Usage"
]
},
"value": {
"en": [
"<span>Rights unassigned staff access only</span>"
]
}
},
{
"label": {
"en": [
"Held by"
]
},
"value": {
"en": [
"The British Library"
]
}
},
{
"label": {
"en": [
"Digitised by"
]
},
"value": {
"en": [
"The British Library 2018"
]
}
},
{
"label": {
"en": [
"Digitisation funded by"
]
},
"value": {
"en": [
"<span>National Lottery Heritage Fund<br><br><img src='https://www.heritagefund.org.uk/sites/default/files/media/attachments/TNLHLF_Colour_Logo_English_RGB_0_0.jpg'/></span>"
]
}
},
{
"label": {
"en": [
"Identifier"
]
},
"value": {
"en": [
"C1700/01"
]
}
},
{
"label": {
"en": [
"Shelfmark"
]
},
"value": {
"en": [
"C1700/01"
]
}
},
{
"label": {
"en": [
"Link to catalogue"
]
},
"value": {
"en": [
"<a href='http://explore.bl.uk/BLVU1:LSCOP-ALL:BLLSA8107626'>View the catalogue record</a>"
]
}
}
],
"requiredStatement": {
"label": {
"en": [
"Copyright and Usage"
]
},
"value": {
"en": [
"<span><a href=\"http://explore.bl.uk/BLVU1:LSCOP-ALL:BLLSA8107626\">Please read the full information about this object</a><br>Rights unassigned - staff access only</span>"
]
}
},
"provider": [
{
"id": "https://www.bl.uk/about-us",
"type": "Agent",
"label": {
"en": [
"The British Library"
]
},
"homepage": [
{
"id": "https://www.bl.uk/",
"type": "Text",
"format": "text/html",
"label": {
"en": [
"The British Library"
]
}
}
],
"logo": [
{
"id": "https://www.bl.uk/images/bl_logo_100.gif",
"type": "Image",
"format": "image/gif"
}
]
}
],
"services": [
{
"id": "https://api.bl.uk/auth/iiif/login",
"type": "AuthCookieService1",
"profile": "http://iiif.io/api/auth/1/login",
"description": {
"en": [
"Some portions of this recording may be unavailable due to rights restrictions."
]
},
"header": {
"en": [
"Please Log-In"
]
},
"label": {
"en": [
"Login to The British Library"
]
},
"service": [
{
"id": "https://api.bl.uk/auth/iiif/token",
"type": "AuthTokenService1",
"profile": "http://iiif.io/api/auth/1/token"
}
]
},
{
"id": "http://access.bl.uk/item/share/ark:/81055/vdc_100063181190.0x000002",
"type": "Service",
"profile": "http://universalviewer.io/share-extensions-profile"
}
],
"homepage": [
{
"id": "http://access.bl.uk/item/viewer/ark:/81055/vdc_100063181190.0x000002",
"type": "Text",
"format": "text/html",
"label": {
"en": [
"View at the British Library"
]
}
}
],
"behavior": [
"auto-advance"
],
"items": [
{
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000004",
"type": "Canvas",
"label": {
"en": [
"Tape 1 Side 1"
]
},
"duration": 2808.8800000000001,
"items": [
{
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000004/anno1",
"type": "AnnotationPage",
"items": [
{
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000004/anno1/1",
"type": "Annotation",
"motivation": "painting",
"target": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000004#t=00.00,2808.88",
"body": {
"type": "Choice",
"items": [
{
"id": "https://api.bl.uk/media/iiif/ark:/81055/vdc_100063181190.0x00000d/manifest.mpd",
"format": "application/dash+xml",
"type": "Sound",
"service": [
{
"id": "https://api.bl.uk/auth/iiif/login",
"type": "AuthCookieService1"
},
{
"id": "https://api.bl.uk/media/dash/ark:/81055/vdc_100063181190.0x00000d/probe.json",
"type": "AuthProbeService1",
"profile": "http://iiif.io/api/auth/1/probe"
}
]
},
{
"id": "https://api.bl.uk/media/iiif/ark:/81055/vdc_100063181190.0x00000d/index.m3u8",
"format": "application/vnd.apple.mpegURL",
"type": "Sound",
"service": [
{
"id": "https://api.bl.uk/auth/iiif/login",
"type": "AuthCookieService1"
},
{
"id": "https://api.bl.uk/media/hls/ark:/81055/vdc_100063181190.0x00000d/probe.json",
"type": "AuthProbeService1",
"profile": "http://iiif.io/api/auth/1/probe"
}
]
}
]
},
"seeAlso": [
{
"id": "https://iiif-waveforms.s3.amazonaws.com/vdc_100063181190.0x00000c.dat",
"type": "Dataset",
"format": "application/octet-stream",
"profile": "http://waveform.prototyping.bbc.co.uk"
}
]
}
]
}
]
},
{
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000005",
"type": "Canvas",
"label": {
"en": [
"Tape 1 Side 2"
]
},
"duration": 1090.28,
"items": [
{
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000005/anno2",
"type": "AnnotationPage",
"items": [
{
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000005/anno2/1",
"type": "Annotation",
"motivation": "painting",
"target": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000005#t=00.00,1090.28",
"body": {
"type": "Choice",
"items": [
{
"id": "https://api.bl.uk/media/iiif/ark:/81055/vdc_100063181190.0x00000f/manifest.mpd",
"format": "application/dash+xml",
"type": "Sound",
"service": [
{
"id": "https://api.bl.uk/auth/iiif/login",
"type": "AuthCookieService1"
},
{
"id": "https://api.bl.uk/media/dash/ark:/81055/vdc_100063181190.0x00000f/probe.json",
"type": "AuthProbeService1",
"profile": "http://iiif.io/api/auth/1/probe"
}
]
},
{
"id": "https://api.bl.uk/media/iiif/ark:/81055/vdc_100063181190.0x00000f/index.m3u8",
"format": "application/vnd.apple.mpegURL",
"type": "Sound",
"service": [
{
"id": "https://api.bl.uk/auth/iiif/login",
"type": "AuthCookieService1"
},
{
"id": "https://api.bl.uk/media/hls/ark:/81055/vdc_100063181190.0x00000f/probe.json",
"type": "AuthProbeService1",
"profile": "http://iiif.io/api/auth/1/probe"
}
]
}
]
},
"seeAlso": [
{
"id": "https://iiif-waveforms.s3.amazonaws.com/vdc_100063181190.0x00000e.dat",
"type": "Dataset",
"format": "application/octet-stream",
"profile": "http://waveform.prototyping.bbc.co.uk"
}
]
}
]
}
]
}
]
}
Loading