feat: add public entry page for KAN-50
CI/CD / preconditions (pull_request) Successful in 1s
CI/CD / Publish immutable image (pull_request) Canceled after 0s
CI/CD / test_and_check_app (pull_request) Canceled after 3m49s

This commit is contained in:
2026-09-16 09:42:45 +02:00
parent b8409a702c
commit f3399808c5
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());
}
}