@@ -243,7 +243,7 @@ describe('folder package export', () => {
243243 const { manifest, entries } = await readExport ( stream ) ;
244244
245245 const childEntry = manifest . workflows ! . find ( ( { id } ) => id === externalChild . id ) ;
246- expect ( childEntry ?. target ) . toBe ( ' workflows/external-child' ) ;
246+ expect ( childEntry ?. target ) . toBe ( ` workflows/external-child- ${ externalChild . id } ` ) ;
247247 expect ( entries . find ( ( e ) => e . name === `${ childEntry ! . target } /workflow.json` ) ) . toBeDefined ( ) ;
248248 expect ( manifest . requirements ?. workflows ) . toEqual ( [
249249 { id : externalChild . id , name : externalChild . name , usedByWorkflows : [ parent . id ] } ,
@@ -317,7 +317,7 @@ describe('folder package export', () => {
317317 expect ( folderShell ( entries , grandchildEntry . target ) . parentFolderId ) . toBe ( child . id ) ;
318318 } ) ;
319319
320- it ( 'disambiguates same-named sibling folders by creation order ' , async ( ) => {
320+ it ( 'gives same-named sibling folders their own targets ' , async ( ) => {
321321 const owner = await createOwner ( ) ;
322322 const project = await createTeamProject ( 'Project A' , owner ) ;
323323 const older = await createFolder ( project , {
@@ -338,9 +338,9 @@ describe('folder package export', () => {
338338
339339 const olderTarget = manifest . folders ! . find ( ( f ) => f . id === older . id ) ! . target ;
340340 const newerTarget = manifest . folders ! . find ( ( f ) => f . id === newer . id ) ! . target ;
341- // Oldest keeps the bare slug; the allocator suffixes the newer one .
342- expect ( olderTarget ) . toBe ( ' folders/inprogress' ) ;
343- expect ( newerTarget ) . toBe ( ' folders/inprogress-2' ) ;
341+ // Each keeps its own id, so neither target depends on which was created first .
342+ expect ( olderTarget ) . toBe ( ` folders/inprogress- ${ older . id } ` ) ;
343+ expect ( newerTarget ) . toBe ( ` folders/inprogress-${ newer . id } ` ) ;
344344 } ) ;
345345
346346 it ( 're-roots an exported folder whose parent is left out of the export' , async ( ) => {
@@ -507,7 +507,7 @@ describe('folder package export — with contained workflows', () => {
507507 {
508508 id : variable . id ,
509509 name : 'API_URL' ,
510- target : ' variables/apiurl' ,
510+ target : ` variables/apiurl- ${ variable . id } ` ,
511511 } ,
512512 ] ) ;
513513 expect ( manifest . requirements ) . toEqual ( {
@@ -602,8 +602,7 @@ describe('folder package export — with contained workflows', () => {
602602 const subfolderTarget = manifest . folders ! . find ( ( f ) => f . id === subfolder . id ) ! . target ;
603603 const workflowTarget = manifest . workflows ! . find ( ( w ) => w . id === workflow . id ) ! . target ;
604604
605- // The subfolder is suffixed; the workflow stays under the parent's container.
606- expect ( subfolderTarget ) . toMatch ( / \/ w o r k f l o w s - 2 $ / ) ;
605+ expect ( subfolderTarget ) . toMatch ( new RegExp ( `/workflows-${ subfolder . id } $` ) ) ;
607606 expect ( workflowTarget . startsWith ( `${ subfolderTarget } /` ) ) . toBe ( false ) ;
608607 } ) ;
609608
0 commit comments