completed story 1.1 with QA tests and fixes
This commit is contained in:
@@ -10,7 +10,7 @@ test('login screen can be rendered', function () {
|
||||
});
|
||||
|
||||
test('users can authenticate using the login screen', function () {
|
||||
$user = User::factory()->withoutTwoFactor()->create();
|
||||
$user = User::factory()->create();
|
||||
|
||||
$response = $this->post(route('login.store'), [
|
||||
'email' => $user->email,
|
||||
@@ -47,7 +47,7 @@ test('users with two factor enabled are redirected to two factor challenge', fun
|
||||
'confirmPassword' => true,
|
||||
]);
|
||||
|
||||
$user = User::factory()->create();
|
||||
$user = User::factory()->withTwoFactor()->create();
|
||||
|
||||
$response = $this->post(route('login.store'), [
|
||||
'email' => $user->email,
|
||||
@@ -66,4 +66,4 @@ test('users can logout', function () {
|
||||
$response->assertRedirect(route('home'));
|
||||
|
||||
$this->assertGuest();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -8,8 +8,9 @@ test('registration screen can be rendered', function () {
|
||||
|
||||
test('new users can register', function () {
|
||||
$response = $this->post(route('register.store'), [
|
||||
'name' => 'John Doe',
|
||||
'full_name' => 'John Doe',
|
||||
'email' => 'test@example.com',
|
||||
'phone' => '+1234567890',
|
||||
'password' => 'password',
|
||||
'password_confirmation' => 'password',
|
||||
]);
|
||||
@@ -18,4 +19,4 @@ test('new users can register', function () {
|
||||
->assertRedirect(route('dashboard', absolute: false));
|
||||
|
||||
$this->assertAuthenticated();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -23,10 +23,10 @@ test('two factor challenge can be rendered', function () {
|
||||
'confirmPassword' => true,
|
||||
]);
|
||||
|
||||
$user = User::factory()->create();
|
||||
$user = User::factory()->withTwoFactor()->create();
|
||||
|
||||
$this->post(route('login.store'), [
|
||||
'email' => $user->email,
|
||||
'password' => 'password',
|
||||
])->assertRedirect(route('two-factor.login'));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user