Skip to content

Commit 8da7ee8

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

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

phpunit.xml.dist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<env name="APP_MAINTENANCE_DRIVER" value="file"/>
1717
<env name="BCRYPT_ROUNDS" value="4"/>
1818
<env name="CACHE_STORE" value="array"/>
19-
<!-- <env name="DB_CONNECTION" value="sqlite"/> -->
20-
<!-- <env name="DB_DATABASE" value=":memory:"/> -->
19+
<env name="DB_CONNECTION" value="sqlite"/>
20+
<env name="DB_DATABASE" value=":memory:"/>
2121
<env name="MAIL_MAILER" value="array"/>
2222
<env name="PULSE_ENABLED" value="false"/>
2323
<env name="QUEUE_CONNECTION" value="sync"/>

tests/Browser/RegisterUserTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
test('it can show the register page', function () {
44
visit('/register')
5+
->assertNoConsoleLogs()
6+
->assertNoJavaScriptErrors()
57
->assertSee('Create an account')
68
->assertSee('Enter your details below to create your account');
79
});
10+
11+
test('it can register a new user', function () {
12+
visit('/register')
13+
->fill('name', 'Taylor Otwell')
14+
->fill('email', '[email protected]')
15+
->fill('password', 'password')
16+
->fill('password_confirmation', 'password')
17+
->press('Create account')
18+
->assertPathEndsWith('/dashboard');
19+
20+
$this->assertAuthenticated();
21+
});

tests/Browser/WelcomeTest.php

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

33
test('it can show the default welcome page', function () {
44
visit('/')
5+
->assertNoConsoleLogs()
6+
->assertNoJavaScriptErrors()
57
->assertSee('Let\'s get started')
68
->assertSee('Log In')
79
->assertSee('Register');
810
});
11+
12+
13+
test('it can browse to the register page', function () {
14+
visit('/')
15+
->assertNoConsoleLogs()
16+
->assertNoJavaScriptErrors()
17+
->click('Register')
18+
->assertPathEndsWith('/register')
19+
->assertNoConsoleLogs()
20+
->assertNoJavaScriptErrors()
21+
->assertSee('Create an account')
22+
->assertSee('Enter your details below to create your account');
23+
});

tests/Pest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
pest()->extend(Tests\TestCase::class)
15-
// ->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
15+
->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
1616
->in('Browser');
1717

1818
/*

0 commit comments

Comments
 (0)