2022-05-14 17:44:14 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\Feature;
|
|
|
|
|
|
|
|
use App\Models\Article;
|
|
|
|
use App\Models\Bookmark;
|
|
|
|
use App\Models\Like;
|
|
|
|
use App\Models\Note;
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
2025-03-01 15:00:41 +00:00
|
|
|
use PHPUnit\Framework\Attributes\Test;
|
2022-05-14 17:44:14 +01:00
|
|
|
use Tests\TestCase;
|
|
|
|
|
|
|
|
class FrontPageTest extends TestCase
|
|
|
|
{
|
|
|
|
use RefreshDatabase;
|
|
|
|
|
2025-03-01 15:00:41 +00:00
|
|
|
#[Test]
|
2025-04-06 17:25:06 +01:00
|
|
|
public function front_page_loads_all_content(): void
|
2022-05-14 17:44:14 +01:00
|
|
|
{
|
|
|
|
Note::factory()->create(['note' => 'Note 1']);
|
|
|
|
Article::factory()->create(['title' => 'Article 1']);
|
|
|
|
Bookmark::factory()->create(['url' => 'https://example.com']);
|
|
|
|
Like::factory()->create([
|
|
|
|
'url' => 'https://example.org/1',
|
|
|
|
'content' => 'Like 1',
|
|
|
|
]);
|
|
|
|
|
|
|
|
$this->get('/')
|
|
|
|
->assertSee('Note 1')
|
|
|
|
->assertSee('Article 1')
|
|
|
|
->assertSee('https://example.com')
|
|
|
|
->assertSee('Like 1');
|
|
|
|
}
|
|
|
|
}
|