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

34 lines
953 B
PHP

<?php
use App\Models\User;
use Livewire\Volt\Volt;
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 () {
$this->actingAs(User::factory()->create());
$this->get(route('company-search'))->assertOk();
});
test('company search page displays correctly', function () {
$this->actingAs(User::factory()->create());
$response = $this->get(route('company-search'));
$response->assertSee('Unternehmensauskunft');
$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');
});