12-05-2026 Frontend dev
This commit is contained in:
parent
405df0a122
commit
5b8bdf4182
779 changed files with 480564 additions and 6241 deletions
|
|
@ -2,14 +2,18 @@
|
|||
|
||||
use App\Models\User;
|
||||
use Livewire\Volt\Volt as LivewireVolt;
|
||||
use Tests\TestCase;
|
||||
|
||||
test('login screen can be rendered', function () {
|
||||
$response = $this->get('/login');
|
||||
/** @var TestCase $this */
|
||||
$portalUrl = rtrim((string) config('domains.domain_portal_url', 'http://presseportale.test'), '/');
|
||||
$response = $this->get($portalUrl.'/login');
|
||||
|
||||
$response->assertStatus(200);
|
||||
});
|
||||
|
||||
test('users can authenticate using the login screen', function () {
|
||||
/** @var TestCase $this */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = LivewireVolt::test('auth.login')
|
||||
|
|
@ -22,9 +26,13 @@ test('users can authenticate using the login screen', function () {
|
|||
->assertRedirect(route('dashboard', absolute: false));
|
||||
|
||||
$this->assertAuthenticated();
|
||||
$user->refresh();
|
||||
expect($user->last_login_at)->not->toBeNull();
|
||||
expect($user->last_login_ip)->toBe('127.0.0.1');
|
||||
});
|
||||
|
||||
test('users can not authenticate with invalid password', function () {
|
||||
/** @var TestCase $this */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = LivewireVolt::test('auth.login')
|
||||
|
|
@ -38,6 +46,7 @@ test('users can not authenticate with invalid password', function () {
|
|||
});
|
||||
|
||||
test('users can logout', function () {
|
||||
/** @var TestCase $this */
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->actingAs($user)->post('/logout');
|
||||
|
|
@ -45,4 +54,4 @@ test('users can logout', function () {
|
|||
$response->assertRedirect('/');
|
||||
|
||||
$this->assertGuest();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue