Files
AFC-Demo/tests/Feature/CompanySearchTest.php
T

34 lines
953 B
PHP
Raw Normal View History

2025-10-17 09:20:35 +02:00
<?php
use App\Models\User;
2025-10-20 09:53:34 +02:00
use Livewire\Volt\Volt;
2025-10-17 09:20:35 +02:00
test('guests are redirected to the login page', function () {
$response = $this->get(route('company-search'));
$response->assertRedirect(route('login'));
});
test('authenticated users can visit the company search page', function () {
2025-10-20 09:53:34 +02:00
$this->actingAs(User::factory()->create());
$this->get(route('company-search'))->assertOk();
});
test('company search page displays correctly', function () {
$this->actingAs(User::factory()->create());
2025-10-17 09:20:35 +02:00
$response = $this->get(route('company-search'));
2025-10-20 09:53:34 +02:00
2025-10-17 09:20:35 +02:00
$response->assertSee('Unternehmensauskunft');
2025-10-20 09:53:34 +02:00
$response->assertSee('Suchen Sie nach Unternehmensinformationen');
});
test('search input is wired to component', function () {
$this->actingAs(User::factory()->create());
Volt::test('company-search')
->assertSet('search', '')
->set('search', 'Test Firma')
->assertSet('search', 'Test Firma');
2025-10-17 09:20:35 +02:00
});