@@ -104,7 +104,7 @@ describe('api/iiif/descriptive', () => {
104
104
105
105
describe ( 'getLogo' , ( ) => {
106
106
it ( 'should ignore missing logos' , ( ) => {
107
- expect ( getLogo ( { } ) ) . toEqual ( null ) ;
107
+ expect ( getLogo ( { } ) ) . toEqual ( [ ] ) ;
108
108
} ) ;
109
109
it ( 'should unwrap service to ID' , ( ) => {
110
110
expect (
@@ -118,22 +118,34 @@ describe('api/iiif/descriptive', () => {
118
118
} ,
119
119
} ,
120
120
} )
121
- ) . toEqual ( 'http://example.org/logos/institution1.jpg' ) ;
121
+ ) . toEqual ( [
122
+ {
123
+ '@id' : 'http://example.org/logos/institution1.jpg' ,
124
+ service : {
125
+ '@context' : 'http://iiif.io/api/image/2/context.json' ,
126
+ '@id' : 'http://example.org/service/inst1' ,
127
+ profile : 'http://iiif.io/api/image/2/level2.json' ,
128
+ } ,
129
+ } ,
130
+ ] ) ;
122
131
expect (
123
132
getLogo ( {
124
133
logo : 'http://example.org/logos/institution1.jpg' ,
125
134
} )
126
- ) . toEqual ( 'http://example.org/logos/institution1.jpg' ) ;
135
+ ) . toEqual ( [ 'http://example.org/logos/institution1.jpg' ] ) ;
127
136
} ) ;
128
- it ( 'should return the first service ' , ( ) => {
137
+ it ( 'should return all images ' , ( ) => {
129
138
expect (
130
139
getLogo ( {
131
140
logo : [
132
141
'http://example.org/logos/institution1.jpg' ,
133
142
'http://example.org/logos/institution2.jpg' ,
134
143
] ,
135
144
} )
136
- ) . toEqual ( 'http://example.org/logos/institution1.jpg' ) ;
145
+ ) . toEqual ( [
146
+ 'http://example.org/logos/institution1.jpg' ,
147
+ 'http://example.org/logos/institution2.jpg' ,
148
+ ] ) ;
137
149
expect (
138
150
getLogo ( {
139
151
logo : [
@@ -155,7 +167,24 @@ describe('api/iiif/descriptive', () => {
155
167
} ,
156
168
] ,
157
169
} )
158
- ) . toEqual ( 'http://example.org/logos/institution1.jpg' ) ;
170
+ ) . toEqual ( [
171
+ {
172
+ '@id' : 'http://example.org/logos/institution1.jpg' ,
173
+ service : {
174
+ '@context' : 'http://iiif.io/api/image/2/context.json' ,
175
+ '@id' : 'http://example.org/service/inst1' ,
176
+ profile : 'http://iiif.io/api/image/2/level2.json' ,
177
+ } ,
178
+ } ,
179
+ {
180
+ '@id' : 'http://example.org/logos/institution2.jpg' ,
181
+ service : {
182
+ '@context' : 'http://iiif.io/api/image/2/context.json' ,
183
+ '@id' : 'http://example.org/service/inst1' ,
184
+ profile : 'http://iiif.io/api/image/2/level2.json' ,
185
+ } ,
186
+ } ,
187
+ ] ) ;
159
188
} ) ;
160
189
} ) ;
161
190
} ) ;
0 commit comments