@@ -12,7 +12,7 @@ const DF = new DataFactory();
12
12
describe ( 'ConfigConstructor' , ( ) => {
13
13
let objectLoader : RdfObjectLoader ;
14
14
let componentResources : Record < string , Resource > ;
15
- let configConstructorPool : jest . Mocked < ConfigConstructorPool < any > > ;
15
+ let configConstructorPool : ConfigConstructorPool < any > ;
16
16
let constructor : ConfigConstructor < any > ;
17
17
let constructionStrategy : IConstructionStrategy < any > ;
18
18
let moduleState : IModuleState ;
@@ -223,7 +223,7 @@ describe('ConfigConstructor', () => {
223
223
. toThrowError ( / ^ M i s s i n g k e y i n f i e l d s e n t r y / u) ;
224
224
} ) ;
225
225
226
- it ( 'can use dereferenced IRI values as keys ' , async ( ) => {
226
+ it ( 'should throw on IRI key ' , async ( ) => {
227
227
const resource = objectLoader . createCompactedResource ( {
228
228
fields : {
229
229
list : [
@@ -234,39 +234,8 @@ describe('ConfigConstructor', () => {
234
234
] ,
235
235
} ,
236
236
} ) ;
237
- expect ( await constructor . getArgumentValue ( resource , settings ) ) . toEqual ( {
238
- entries : [
239
- {
240
- key : 'INSTANCE' ,
241
- value : 'ABC' ,
242
- } ,
243
- ] ,
244
- } ) ;
245
- expect ( constructionStrategy . createHash ) . toHaveBeenCalledWith ( {
246
- settings,
247
- entries : [
248
- {
249
- key : 'INSTANCE' ,
250
- value : 'ABC' ,
251
- } ,
252
- ] ,
253
- } ) ;
254
- } ) ;
255
-
256
- it ( 'should throw on non-string keys' , async ( ) => {
257
- configConstructorPool . instantiate . mockResolvedValueOnce ( new Error ( 'this is an object' ) ) ;
258
- const resource = objectLoader . createCompactedResource ( {
259
- fields : {
260
- list : [
261
- {
262
- key : `ex:abc` ,
263
- value : '"ABC"' ,
264
- } ,
265
- ] ,
266
- } ,
267
- } ) ;
268
237
await expect ( constructor . getArgumentValue ( resource , settings ) ) . rejects
269
- . toThrowError ( / ^ I l l e g a l n o n - s t r i n g k e y \( e x : a b c a s N a m e d N o d e \) i n f i e l d s e n t r y / u) ;
238
+ . toThrowError ( / ^ I l l e g a l n o n - l i t e r a l k e y \( e x : a b c a s N a m e d N o d e \) i n f i e l d s e n t r y / u) ;
270
239
} ) ;
271
240
272
241
it ( 'should ignore fields without value' , async ( ) => {
0 commit comments