Skip to content

Commit 5738e57

Browse files
Add test infrastructure to project. (#48)
Co-authored-by: Stephen Fraser <[email protected]>
1 parent 5d06c0a commit 5738e57

File tree

12 files changed

+8900
-2059
lines changed

12 files changed

+8900
-2059
lines changed

.github/workflows/build-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ jobs:
2424
node-version: ${{ matrix.node }}
2525
- run: npm ci
2626
- run: npm run build
27+
- run: npm test

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
node-version: '18'
2323
- run: npm ci
2424
- run: npm run build
25+
- run: npm test
2526

2627
release:
2728
needs: [build]

__tests__/fixtures/bl-av-auth.json

Lines changed: 366 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,366 @@
1+
{
2+
"@context": [
3+
"http://iiif.io/api/auth/1/context.json",
4+
"http://iiif.io/api/presentation/3/context.json"
5+
],
6+
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000002/manifest.json",
7+
"type": "Manifest",
8+
"label": {
9+
"en": [
10+
"George Evans / Basil Bunting"
11+
]
12+
},
13+
"metadata": [
14+
{
15+
"label": {
16+
"en": [
17+
"Full title"
18+
]
19+
},
20+
"value": {
21+
"en": [
22+
"George Evans / Basil Bunting"
23+
]
24+
}
25+
},
26+
{
27+
"label": {
28+
"en": [
29+
"Collection"
30+
]
31+
},
32+
"value": {
33+
"en": [
34+
"Robert Hampson tapes"
35+
]
36+
}
37+
},
38+
{
39+
"label": {
40+
"en": [
41+
"Format"
42+
]
43+
},
44+
"value": {
45+
"en": [
46+
"1 compact cassette"
47+
]
48+
}
49+
},
50+
{
51+
"label": {
52+
"en": [
53+
"Usage"
54+
]
55+
},
56+
"value": {
57+
"en": [
58+
"<span>Rights unassigned staff access only</span>"
59+
]
60+
}
61+
},
62+
{
63+
"label": {
64+
"en": [
65+
"Held by"
66+
]
67+
},
68+
"value": {
69+
"en": [
70+
"The British Library"
71+
]
72+
}
73+
},
74+
{
75+
"label": {
76+
"en": [
77+
"Digitised by"
78+
]
79+
},
80+
"value": {
81+
"en": [
82+
"The British Library 2018"
83+
]
84+
}
85+
},
86+
{
87+
"label": {
88+
"en": [
89+
"Digitisation funded by"
90+
]
91+
},
92+
"value": {
93+
"en": [
94+
"<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>"
95+
]
96+
}
97+
},
98+
{
99+
"label": {
100+
"en": [
101+
"Identifier"
102+
]
103+
},
104+
"value": {
105+
"en": [
106+
"C1700/01"
107+
]
108+
}
109+
},
110+
{
111+
"label": {
112+
"en": [
113+
"Shelfmark"
114+
]
115+
},
116+
"value": {
117+
"en": [
118+
"C1700/01"
119+
]
120+
}
121+
},
122+
{
123+
"label": {
124+
"en": [
125+
"Link to catalogue"
126+
]
127+
},
128+
"value": {
129+
"en": [
130+
"<a href='http://explore.bl.uk/BLVU1:LSCOP-ALL:BLLSA8107626'>View the catalogue record</a>"
131+
]
132+
}
133+
}
134+
],
135+
"requiredStatement": {
136+
"label": {
137+
"en": [
138+
"Copyright and Usage"
139+
]
140+
},
141+
"value": {
142+
"en": [
143+
"<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>"
144+
]
145+
}
146+
},
147+
"provider": [
148+
{
149+
"id": "https://www.bl.uk/about-us",
150+
"type": "Agent",
151+
"label": {
152+
"en": [
153+
"The British Library"
154+
]
155+
},
156+
"homepage": [
157+
{
158+
"id": "https://www.bl.uk/",
159+
"type": "Text",
160+
"format": "text/html",
161+
"label": {
162+
"en": [
163+
"The British Library"
164+
]
165+
}
166+
}
167+
],
168+
"logo": [
169+
{
170+
"id": "https://www.bl.uk/images/bl_logo_100.gif",
171+
"type": "Image",
172+
"format": "image/gif"
173+
}
174+
]
175+
}
176+
],
177+
"services": [
178+
{
179+
"id": "https://api.bl.uk/auth/iiif/login",
180+
"type": "AuthCookieService1",
181+
"profile": "http://iiif.io/api/auth/1/login",
182+
"description": {
183+
"en": [
184+
"Some portions of this recording may be unavailable due to rights restrictions."
185+
]
186+
},
187+
"header": {
188+
"en": [
189+
"Please Log-In"
190+
]
191+
},
192+
"label": {
193+
"en": [
194+
"Login to The British Library"
195+
]
196+
},
197+
"service": [
198+
{
199+
"id": "https://api.bl.uk/auth/iiif/token",
200+
"type": "AuthTokenService1",
201+
"profile": "http://iiif.io/api/auth/1/token"
202+
}
203+
]
204+
},
205+
{
206+
"id": "http://access.bl.uk/item/share/ark:/81055/vdc_100063181190.0x000002",
207+
"type": "Service",
208+
"profile": "http://universalviewer.io/share-extensions-profile"
209+
}
210+
],
211+
"homepage": [
212+
{
213+
"id": "http://access.bl.uk/item/viewer/ark:/81055/vdc_100063181190.0x000002",
214+
"type": "Text",
215+
"format": "text/html",
216+
"label": {
217+
"en": [
218+
"View at the British Library"
219+
]
220+
}
221+
}
222+
],
223+
"behavior": [
224+
"auto-advance"
225+
],
226+
"items": [
227+
{
228+
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000004",
229+
"type": "Canvas",
230+
"label": {
231+
"en": [
232+
"Tape 1 Side 1"
233+
]
234+
},
235+
"duration": 2808.8800000000001,
236+
"items": [
237+
{
238+
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000004/anno1",
239+
"type": "AnnotationPage",
240+
"items": [
241+
{
242+
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000004/anno1/1",
243+
"type": "Annotation",
244+
"motivation": "painting",
245+
"target": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000004#t=00.00,2808.88",
246+
"body": {
247+
"type": "Choice",
248+
"items": [
249+
{
250+
"id": "https://api.bl.uk/media/iiif/ark:/81055/vdc_100063181190.0x00000d/manifest.mpd",
251+
"format": "application/dash+xml",
252+
"type": "Sound",
253+
"service": [
254+
{
255+
"id": "https://api.bl.uk/auth/iiif/login",
256+
"type": "AuthCookieService1"
257+
},
258+
{
259+
"id": "https://api.bl.uk/media/dash/ark:/81055/vdc_100063181190.0x00000d/probe.json",
260+
"type": "AuthProbeService1",
261+
"profile": "http://iiif.io/api/auth/1/probe"
262+
}
263+
]
264+
},
265+
{
266+
"id": "https://api.bl.uk/media/iiif/ark:/81055/vdc_100063181190.0x00000d/index.m3u8",
267+
"format": "application/vnd.apple.mpegURL",
268+
"type": "Sound",
269+
"service": [
270+
{
271+
"id": "https://api.bl.uk/auth/iiif/login",
272+
"type": "AuthCookieService1"
273+
},
274+
{
275+
"id": "https://api.bl.uk/media/hls/ark:/81055/vdc_100063181190.0x00000d/probe.json",
276+
"type": "AuthProbeService1",
277+
"profile": "http://iiif.io/api/auth/1/probe"
278+
}
279+
]
280+
}
281+
]
282+
},
283+
"seeAlso": [
284+
{
285+
"id": "https://iiif-waveforms.s3.amazonaws.com/vdc_100063181190.0x00000c.dat",
286+
"type": "Dataset",
287+
"format": "application/octet-stream",
288+
"profile": "http://waveform.prototyping.bbc.co.uk"
289+
}
290+
]
291+
}
292+
]
293+
}
294+
]
295+
},
296+
{
297+
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000005",
298+
"type": "Canvas",
299+
"label": {
300+
"en": [
301+
"Tape 1 Side 2"
302+
]
303+
},
304+
"duration": 1090.28,
305+
"items": [
306+
{
307+
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000005/anno2",
308+
"type": "AnnotationPage",
309+
"items": [
310+
{
311+
"id": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000005/anno2/1",
312+
"type": "Annotation",
313+
"motivation": "painting",
314+
"target": "https://api.bl.uk/metadata/iiif/ark:/81055/vdc_100063181190.0x000005#t=00.00,1090.28",
315+
"body": {
316+
"type": "Choice",
317+
"items": [
318+
{
319+
"id": "https://api.bl.uk/media/iiif/ark:/81055/vdc_100063181190.0x00000f/manifest.mpd",
320+
"format": "application/dash+xml",
321+
"type": "Sound",
322+
"service": [
323+
{
324+
"id": "https://api.bl.uk/auth/iiif/login",
325+
"type": "AuthCookieService1"
326+
},
327+
{
328+
"id": "https://api.bl.uk/media/dash/ark:/81055/vdc_100063181190.0x00000f/probe.json",
329+
"type": "AuthProbeService1",
330+
"profile": "http://iiif.io/api/auth/1/probe"
331+
}
332+
]
333+
},
334+
{
335+
"id": "https://api.bl.uk/media/iiif/ark:/81055/vdc_100063181190.0x00000f/index.m3u8",
336+
"format": "application/vnd.apple.mpegURL",
337+
"type": "Sound",
338+
"service": [
339+
{
340+
"id": "https://api.bl.uk/auth/iiif/login",
341+
"type": "AuthCookieService1"
342+
},
343+
{
344+
"id": "https://api.bl.uk/media/hls/ark:/81055/vdc_100063181190.0x00000f/probe.json",
345+
"type": "AuthProbeService1",
346+
"profile": "http://iiif.io/api/auth/1/probe"
347+
}
348+
]
349+
}
350+
]
351+
},
352+
"seeAlso": [
353+
{
354+
"id": "https://iiif-waveforms.s3.amazonaws.com/vdc_100063181190.0x00000e.dat",
355+
"type": "Dataset",
356+
"format": "application/octet-stream",
357+
"profile": "http://waveform.prototyping.bbc.co.uk"
358+
}
359+
]
360+
}
361+
]
362+
}
363+
]
364+
}
365+
]
366+
}

0 commit comments

Comments
 (0)