feat: add public entry page for KAN-50

This commit is contained in:
2026-09-16 07:46:21 +00:00
committed by Twyco
parent 0a974cfd49
commit 8a9113a7af
6 changed files with 604 additions and 412 deletions
+45
View File
@@ -0,0 +1,45 @@
<?php
namespace Tests\Feature;
use App\Models\User;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Inertia\Testing\AssertableInertia as Assert;
use Symfony\Component\Process\Process;
use Tests\TestCase;
class WelcomeTest extends TestCase
{
use RefreshDatabase;
public function test_public_entry_page_is_available_to_guests(): void
{
$this->get(route('home'))
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('Welcome')
->where('auth.user', null));
}
public function test_public_entry_page_recognizes_authenticated_users(): void
{
$user = User::factory()->create();
$this->actingAs($user)
->get(route('home'))
->assertOk()
->assertInertia(fn (Assert $page) => $page
->component('Welcome')
->where('auth.user.id', $user->id));
}
public function test_public_entry_page_presentation_and_localization(): void
{
$process = new Process(['node', 'tests/Fixtures/welcome.mjs'], base_path());
$process->setTimeout(60);
$process->run();
$this->assertTrue($process->isSuccessful(), $process->getOutput().$process->getErrorOutput());
$this->assertStringContainsString('Welcome behavior checks passed.', $process->getOutput());
}
}