Skip to content

Commit cab6a56

Browse files
committed
wip
Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent 8d78d07 commit cab6a56

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
test('login screen can be rendered', function () {
4+
visit('/login')
5+
->assertNoConsoleLogs()
6+
->assertNoJavaScriptErrors()
7+
->assertSee('Log in to your account')
8+
->assertSee('Enter your email and password below to log in');
9+
});

tests/Browser/RegisterUserTest.php renamed to tests/Browser/Auth/RegistrationTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
use App\Models\User;
44

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

13-
test('it can register a new user', function () {
13+
test('new user can be registered', function () {
1414
visit('/register')
1515
->fill('name', 'Taylor Otwell')
1616
->fill('email', '[email protected]')
@@ -22,7 +22,7 @@
2222
$this->assertAuthenticated();
2323
});
2424

25-
test('it cannot register a new user when email has already been taken', function () {
25+
test('new user cannot be registered when email has already been taken', function () {
2626
User::factory()->create([
2727
'name' => 'Taylor',
2828
'email' => '[email protected]',
@@ -39,7 +39,7 @@
3939
$this->assertGuest();
4040
});
4141

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

tests/Browser/DashboardTest.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
test('guests are redirected to the login page', function () {
4+
visit('/dashboard')
5+
->assertPathEndsWith('/login')
6+
->assertNoConsoleLogs()
7+
->assertNoJavaScriptErrors()
8+
->assertSee('Log in to your account')
9+
->assertSee('Enter your email and password below to log in');
10+
});

tests/Browser/WelcomeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
test('it can show the default welcome page', function () {
3+
test('welcome screen can be rendered', function () {
44
visit('/')
55
->assertNoConsoleLogs()
66
->assertNoJavaScriptErrors()
@@ -9,7 +9,7 @@
99
->assertSee('Register');
1010
});
1111

12-
test('it can browse to the register page', function () {
12+
test('guests can browse to register page from welcome page', function () {
1313
visit('/')
1414
->click('Register')
1515
->assertPathEndsWith('/register')
@@ -19,7 +19,7 @@
1919
->assertSee('Enter your details below to create your account');
2020
});
2121

22-
test('it can browse to the login page', function () {
22+
test('guests can browse to login page from welcome page', function () {
2323
visit('/')
2424
->click('Log in')
2525
->assertPathEndsWith('/login')

0 commit comments

Comments
 (0)