Skip to content

Commit

Permalink
Add sitemap link test
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed May 20, 2022
1 parent 710d3d1 commit 9ba7b10
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/Feature/Concerns/HasPageMetadataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,4 +203,20 @@ public function testGetDynamicMetadataAddsCanonicalUrlWhenConditionsAreMet()
$page->getDynamicMetadata()
);
}



public function testGetDynamicMetadataAddsSitemapLinkWhenConditionsAreMet()
{
$page = new class extends AbstractPage
{
use HasPageMetadata;
};
config(['hyde.site_url' => 'https://example.com']);
config(['hyde.generateSitemap' => true]);

$this->assertEquals(['<link rel="sitemap" type="application/xml" title="Sitemap" href="https://example.com/sitemap.xml" />'],
$page->getDynamicMetadata()
);
}
}

0 comments on commit 9ba7b10

Please sign in to comment.