mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
38 lines
998 B
PHP
Executable File
38 lines
998 B
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\User;
|
|
use Laravel\Jetstream\Features;
|
|
|
|
test('confirm password screen can be rendered', function (): void {
|
|
$user = Features::hasTeamFeatures()
|
|
? User::factory()->withPersonalTeam()->create()
|
|
: User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->get('/user/confirm-password');
|
|
|
|
$response->assertStatus(200);
|
|
});
|
|
|
|
test('password can be confirmed', function (): void {
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->post('/user/confirm-password', [
|
|
'password' => 'password',
|
|
]);
|
|
|
|
$response->assertRedirect();
|
|
$response->assertSessionHasNoErrors();
|
|
});
|
|
|
|
test('password is not confirmed with invalid password', function (): void {
|
|
$user = User::factory()->create();
|
|
|
|
$response = $this->actingAs($user)->post('/user/confirm-password', [
|
|
'password' => 'wrong-password',
|
|
]);
|
|
|
|
$response->assertSessionHasErrors();
|
|
});
|