pgsql db connection and testing route added

This commit is contained in:
2025-10-20 09:53:34 +02:00
parent 7503ae7c04
commit d7fc25def6
5 changed files with 50 additions and 45 deletions
+19 -3
View File
@@ -1,6 +1,7 @@
<?php
use App\Models\User;
use Livewire\Volt\Volt;
test('guests are redirected to the login page', function () {
$response = $this->get(route('company-search'));
@@ -8,10 +9,25 @@ test('guests are redirected to the login page', function () {
});
test('authenticated users can visit the company search page', function () {
$user = User::factory()->create();
$this->actingAs($user);
$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->assertSuccessful();
$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');
});