@@ -226,7 +226,7 @@ describe('link', () => {
226
226
) ;
227
227
228
228
await expect ( readFile ( diagram , { encoding : 'utf8' } ) ) . resolves . toContain (
229
- `id: ${ mockedEmptyDiagram . documentID } ` ,
229
+ `id: https://test.mermaidchart.invalid/d/ ${ mockedEmptyDiagram . documentID } ` ,
230
230
) ;
231
231
} ) ;
232
232
@@ -271,7 +271,7 @@ describe('link', () => {
271
271
await Promise . all (
272
272
[ diagram , diagram2 , diagram3 ] . map ( async ( file ) => {
273
273
await expect ( readFile ( file , { encoding : 'utf8' } ) ) . resolves . toContain (
274
- `id: ${ mockedEmptyDiagram . documentID } ` ,
274
+ `id: https://test.mermaidchart.invalid/d/ ${ mockedEmptyDiagram . documentID } ` ,
275
275
) ;
276
276
} ) ,
277
277
) ;
@@ -298,8 +298,10 @@ describe('link', () => {
298
298
299
299
const file = await readFile ( unlinkedMarkdownFile , { encoding : 'utf8' } ) ;
300
300
301
- expect ( file ) . toMatch ( `id: ${ mockedEmptyDiagram . documentID } \n` ) ;
302
- expect ( file ) . toMatch ( `id: second-id\n` ) ;
301
+ expect ( file ) . toMatch (
302
+ `id: https://test.mermaidchart.invalid/d/${ mockedEmptyDiagram . documentID } \n` ,
303
+ ) ;
304
+ expect ( file ) . toMatch ( `id: https://test.mermaidchart.invalid/d/second-id\n` ) ;
303
305
} ) ;
304
306
305
307
it ( 'should link diagrams in partially linked markdown file' , async ( ) => {
@@ -323,7 +325,7 @@ describe('link', () => {
323
325
324
326
const file = await readFile ( partiallyLinkedMarkdownFile , { encoding : 'utf8' } ) ;
325
327
326
- expect ( file ) . toMatch ( `id: second-id\n` ) ;
328
+ expect ( file ) . toMatch ( `id: https://test.mermaidchart.invalid/d/ second-id\n` ) ;
327
329
} ) ;
328
330
329
331
it ( 'should handle unusual markdown formatting' , async ( ) => {
@@ -347,7 +349,7 @@ describe('link', () => {
347
349
348
350
const file = await readFile ( unusualMarkdownFile , { encoding : 'utf8' } ) ;
349
351
350
- const idLineRegex = / ^ .* i d : m y - m o c k e d - d i a g r a m - i d \n / gm;
352
+ const idLineRegex = / ^ .* i d : h t t p s : \/ \/ t e s t . m e r m a i d c h a r t . i n v a l i d \/ d \/ m y - m o c k e d - d i a g r a m - i d \n / gm;
351
353
352
354
expect ( file ) . toMatch ( idLineRegex ) ;
353
355
// other than the added `id: xxxx` field, everything else should be identical,
@@ -412,7 +414,9 @@ title: My cool flowchart
412
414
for ( const file of [ diagram , diagram2 ] ) {
413
415
const diagramContents = await readFile ( file , { encoding : 'utf8' } ) ;
414
416
415
- expect ( diagramContents ) . toContain ( `id: ${ mockedDiagram . documentID } ` ) ;
417
+ expect ( diagramContents ) . toContain (
418
+ `id: https://test.mermaidchart.invalid/d/${ mockedDiagram . documentID } ` ,
419
+ ) ;
416
420
expect ( diagramContents ) . toContain ( "flowchart TD\n A[I've been updated!]" ) ;
417
421
}
418
422
} ) ;
0 commit comments