Skip to content

Commit 4cf3a48

Browse files
committed
wip
Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent ddfde8b commit 4cf3a48

File tree

5 files changed

+30
-11
lines changed

5 files changed

+30
-11
lines changed
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
<?php
22

3+
use App\Models\User;
4+
35
test('login screen can be rendered', function () {
4-
visit('/login')
6+
visit(route('login'))
57
->assertNoConsoleLogs()
68
->assertNoJavaScriptErrors()
79
->assertSee('Log in to your account')
810
->assertSee('Enter your email and password below to log in');
911
});
12+
13+
test('users_can_authenticate_using_the_login_screen', function () {
14+
$user = User::factory()->create();
15+
16+
visit(route('login'))
17+
->fill('email', $user->email)
18+
->fill('password', 'password')
19+
->press('Log in')
20+
->assertUrlIs(route('dashboard'));
21+
22+
$this->assertAuthenticated();
23+
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
test('email verification screen can be rendered', function () {
4+
5+
});

tests/Browser/Auth/RegistrationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
use App\Models\User;
44

55
test('registration screen can be rendered', function () {
6-
visit('/register')
6+
visit(route('register'))
77
->assertNoConsoleLogs()
88
->assertNoJavaScriptErrors()
99
->assertSee('Create an account')
1010
->assertSee('Enter your details below to create your account');
1111
});
1212

1313
test('new user can be registered', function () {
14-
visit('/register')
14+
visit(route('register'))
1515
->fill('name', 'Taylor Otwell')
1616
->fill('email', '[email protected]')
1717
->fill('password', 'password')
@@ -28,7 +28,7 @@
2828
'email' => '[email protected]',
2929
]);
3030

31-
visit('/register')
31+
visit(route('register'))
3232
->fill('name', 'Taylor Otwell')
3333
->fill('email', '[email protected]')
3434
->fill('password', 'password')
@@ -40,7 +40,7 @@
4040
});
4141

4242
test('new user cannot be registered when password does not match', function () {
43-
visit('/register')
43+
visit(route('register'))
4444
->fill('name', 'Taylor Otwell')
4545
->fill('email', '[email protected]')
4646
->fill('password', 'password')

tests/Browser/DashboardTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
use App\Models\User;
44

55
test('guests are redirected to the login page', function () {
6-
visit('/dashboard')
7-
->assertPathEndsWith('/login')
6+
visit(route('dashboard'))
7+
->assertUrlIs(route('login'))
88
->assertNoConsoleLogs()
99
->assertNoJavaScriptErrors()
1010
->assertSee('Log in to your account')
@@ -14,8 +14,8 @@
1414
test('authenticated users can visit the dashboard', function () {
1515
$this->actingAs(User::factory()->create());
1616

17-
visit('/dashboard')
18-
->assertPathEndsWith('/dashboard')
17+
visit(route('dashboard'))
18+
->assertUrlIs(route('dashboard'))
1919
->assertNoConsoleLogs()
2020
->assertNoJavaScriptErrors();
2121
});

tests/Browser/WelcomeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
test('guests can browse to register page from welcome page', function () {
1313
visit('/')
1414
->click('Register')
15-
->assertPathEndsWith('/register')
15+
->assertUrlIs(route('register'))
1616
->assertNoConsoleLogs()
1717
->assertNoJavaScriptErrors()
1818
->assertSee('Create an account')
@@ -22,7 +22,7 @@
2222
test('guests can browse to login page from welcome page', function () {
2323
visit('/')
2424
->click('Log in')
25-
->assertPathEndsWith('/login')
25+
->assertUrlIs(route('login'))
2626
->assertNoConsoleLogs()
2727
->assertNoJavaScriptErrors()
2828
->assertSee('Log in to your account')

0 commit comments

Comments
 (0)