completed story 1.1 with QA tests and fixes

This commit is contained in:
Naser Mansour
2025-12-26 13:46:39 +02:00
parent 028ce573b9
commit 84d9c2f66a
57 changed files with 2193 additions and 85 deletions
+3 -3
View File
@@ -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();
});
});
+3 -2
View File
@@ -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'));
});
});