fixed sanitazer and academy
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use App\Models\Tag;
|
||||
use App\Models\User;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
@@ -33,6 +34,50 @@ it('renders seo tags on auth blade pages', function (): void {
|
||||
$this->assertStringContainsString('meta name="robots" content="noindex,nofollow"', $html);
|
||||
});
|
||||
|
||||
it('renders canonical tags on public discovery and creator pages', function (string $url, string $routeName): void {
|
||||
$response = $this->get($url);
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
$html = $response->getContent();
|
||||
$this->assertNotFalse($html);
|
||||
$this->assertStringContainsString('<link rel="canonical" href="' . route($routeName) . '" />', $html);
|
||||
})->with([
|
||||
'discover on this day' => ['/discover/on-this-day', 'discover.on-this-day'],
|
||||
'discover rising' => ['/discover/rising', 'discover.rising'],
|
||||
'discover top rated' => ['/discover/top-rated', 'discover.top-rated'],
|
||||
'discover most downloaded' => ['/discover/most-downloaded', 'discover.most-downloaded'],
|
||||
'discover fresh' => ['/discover/fresh', 'discover.fresh'],
|
||||
'discover trending' => ['/discover/trending', 'discover.trending'],
|
||||
'top creators' => ['/creators/top', 'creators.top'],
|
||||
]);
|
||||
|
||||
it('renders a canonical tag on the register page', function (): void {
|
||||
$response = $this->get('/register');
|
||||
|
||||
$response->assertOk();
|
||||
|
||||
$html = $response->getContent();
|
||||
$this->assertNotFalse($html);
|
||||
$this->assertStringContainsString('<link rel="canonical" href="' . route('register') . '" />', $html);
|
||||
});
|
||||
|
||||
it('renders canonical atom links in rss feed headers', function (): void {
|
||||
Tag::factory()->create([
|
||||
'name' => 'Abstract Composition',
|
||||
'slug' => 'abstract-composition',
|
||||
'is_active' => true,
|
||||
]);
|
||||
|
||||
$this->get('/rss')
|
||||
->assertOk()
|
||||
->assertSee('<atom:link href="' . route('rss.global') . '" rel="canonical" />', false);
|
||||
|
||||
$this->get('/rss/tag/abstract-composition')
|
||||
->assertOk()
|
||||
->assertSee('<atom:link href="' . route('rss.tag', ['slug' => 'abstract-composition']) . '" rel="canonical" />', false);
|
||||
});
|
||||
|
||||
it('renders seo tags on upload and studio pages', function (): void {
|
||||
$user = User::factory()->create();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user