File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
packages/router-sitemap/tests Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -544,4 +544,28 @@ describe('generateSitemap', () => {
544
544
} ) ,
545
545
) . rejects . toThrow ( 'Invalid entry /array-return: entry must be an object' )
546
546
} )
547
+
548
+ test ( 'path property should not appear in XML output' , async ( ) => {
549
+ const result = await generateSitemap ( {
550
+ siteUrl : 'https://example.com' ,
551
+ routes : [
552
+ [
553
+ '/posts/$postId' as any ,
554
+ ( ) => [
555
+ { path : '/posts/1' , priority : 0.8 } ,
556
+ { path : '/posts/2' , priority : 0.8 } ,
557
+ ] ,
558
+ ] ,
559
+ ] ,
560
+ } )
561
+
562
+ // Should contain the correct loc elements
563
+ expect ( result ) . toContain ( '<loc>https://example.com/posts/1</loc>' )
564
+ expect ( result ) . toContain ( '<loc>https://example.com/posts/2</loc>' )
565
+
566
+ // Should NOT contain path elements in XML
567
+ expect ( result ) . not . toContain ( '<path>/posts/1</path>' )
568
+ expect ( result ) . not . toContain ( '<path>/posts/2</path>' )
569
+ expect ( result ) . not . toContain ( '<path>' )
570
+ } )
547
571
} )
You can’t perform that action at this time.
0 commit comments