@@ -403,6 +403,67 @@ describe('/libraries', () => {
403403 utils . removeImageFile ( `${ testAssetDir } /temp/folder} b/assetB.png` ) ;
404404 } ) ;
405405
406+ const annoyingChars = [
407+ "'" ,
408+ '"' ,
409+ '`' ,
410+ '*' ,
411+ '{' ,
412+ '}' ,
413+ ',' ,
414+ '(' ,
415+ ')' ,
416+ '[' ,
417+ ']' ,
418+ '?' ,
419+ '!' ,
420+ '@' ,
421+ '#' ,
422+ '$' ,
423+ '%' ,
424+ '^' ,
425+ '&' ,
426+ '=' ,
427+ '+' ,
428+ '~' ,
429+ '|' ,
430+ '<' ,
431+ '>' ,
432+ ';' ,
433+ ':' ,
434+ '/' , // We never got backslashes to work
435+ ] ;
436+
437+ it . each ( annoyingChars ) ( 'should scan multiple import paths with %s' , async ( char ) => {
438+ const library = await utils . createLibrary ( admin . accessToken , {
439+ ownerId : admin . userId ,
440+ importPaths : [ `${ testAssetDirInternal } /temp/folder${ char } 1` , `${ testAssetDirInternal } /temp/folder${ char } 2` ] ,
441+ } ) ;
442+
443+ utils . createImageFile ( `${ testAssetDir } /temp/folder${ char } 1/asset1.png` ) ;
444+ utils . createImageFile ( `${ testAssetDir } /temp/folder${ char } 2/asset2.png` ) ;
445+
446+ const { status } = await request ( app )
447+ . post ( `/libraries/${ library . id } /scan` )
448+ . set ( 'Authorization' , `Bearer ${ admin . accessToken } ` )
449+ . send ( ) ;
450+ expect ( status ) . toBe ( 204 ) ;
451+
452+ await utils . waitForQueueFinish ( admin . accessToken , 'library' ) ;
453+
454+ const { assets } = await utils . searchAssets ( admin . accessToken , { libraryId : library . id } ) ;
455+
456+ expect ( assets . items ) . toEqual (
457+ expect . arrayContaining ( [
458+ expect . objectContaining ( { originalPath : expect . stringContaining ( `folder${ char } 1/asset1.png` ) } ) ,
459+ expect . objectContaining ( { originalPath : expect . stringContaining ( `folder${ char } 2/asset2.png` ) } ) ,
460+ ] ) ,
461+ ) ;
462+
463+ utils . removeImageFile ( `${ testAssetDir } /temp/folder${ char } 1/asset1.png` ) ;
464+ utils . removeImageFile ( `${ testAssetDir } /temp/folder${ char } 2/asset2.png` ) ;
465+ } ) ;
466+
406467 it ( 'should reimport a modified file' , async ( ) => {
407468 const library = await utils . createLibrary ( admin . accessToken , {
408469 ownerId : admin . userId ,
0 commit comments