Skip to content
This repository was archived by the owner on Feb 21, 2025. It is now read-only.

Commit 6acdce6

Browse files
authored
Version bump + Improved Dusk tests + Native Password Confirmation (#13)
1 parent 561ae13 commit 6acdce6

File tree

13 files changed

+40
-48
lines changed

13 files changed

+40
-48
lines changed

.github/workflows/run-tests.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: ubuntu-latest
88

99
strategy:
10-
fail-fast: true
10+
fail-fast: false
1111
matrix:
1212
php: [8.2, 8.1, 8.0]
1313
laravel: [9.*]
@@ -32,11 +32,6 @@ jobs:
3232
run: rm -rf vendor/protonemedia/laravel-splade-breeze
3333
if: matrix.os == 'ubuntu-latest'
3434

35-
- name: Remove installed Breeze (Windows)
36-
run: rd "vendor/protonemedia/laravel-splade-breeze" /s /q
37-
shell: cmd
38-
if: matrix.os == 'windows-latest'
39-
4035
- name: Checkout code
4136
uses: actions/checkout@v2
4237
with:
@@ -57,8 +52,8 @@ jobs:
5752
- name: Run Dusk Tests
5853
uses: nick-invision/retry@v2
5954
with:
60-
timeout_minutes: 5
61-
max_attempts: 3
55+
timeout_minutes: 10
56+
max_attempts: 5
6257
command: php artisan dusk --env=dusk
6358

6459
- name: Upload Dusk Screenshots

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"illuminate/filesystem": "^9.37",
2929
"illuminate/support": "^9.37",
3030
"illuminate/validation": "^9.37",
31-
"protonemedia/laravel-splade": "^1.2.2"
31+
"protonemedia/laravel-splade": "^1.2.9"
3232
},
3333
"conflict": {
3434
"laravel/framework": "<9.37.0"

src/Console/InstallsSpladeStack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ protected function installSpladeStack()
2525
// NPM Packages...
2626
$this->updateNodePackages(function ($packages) {
2727
return [
28-
'@protonemedia/laravel-splade' => '^1.2.2',
28+
'@protonemedia/laravel-splade' => '^1.2.9',
2929
'@tailwindcss/forms' => '^0.5.3',
3030
'@tailwindcss/typography' => '^0.5.2',
3131
'@vitejs/plugin-vue' => '^3.0.0',

stubs/splade/dusk-tests/Auth/AuthenticationTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public function test_login_screen_can_be_rendered()
1717
$this->browse(function (Browser $browser) {
1818
$browser->logout()
1919
->visit('/login')
20+
->waitForInput('email')
2021
->assertInputPresent('email')
2122
->assertInputPresent('password');
2223
});
@@ -29,6 +30,7 @@ public function test_users_can_authenticate_using_the_login_screen()
2930

3031
$browser->logout()
3132
->visit('/login')
33+
->waitForInput('email')
3234
->type('email', $user->email)
3335
->type('password', 'password')
3436
->press('Log in')
@@ -44,6 +46,7 @@ public function test_users_can_not_authenticate_with_invalid_password()
4446

4547
$browser->logout()
4648
->visit('/login')
49+
->waitForInput('email')
4750
->type('email', $user->email)
4851
->type('password', 'wrong-password')
4952
->press('Log in')

stubs/splade/dusk-tests/Auth/EmailVerificationTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public function test_email_verification_screen_can_be_rendered()
2222

2323
$browser->loginAs($user)
2424
->visit('/verify-email')
25+
->waitForText('Thanks for signing up!')
2526
->assertSeeIn('button', 'Resend Verification Email');
2627
});
2728
}

stubs/splade/dusk-tests/Auth/PasswordConfirmationTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function test_confirm_password_screen_can_be_rendered()
1919

2020
$browser->loginAs($user)
2121
->visit('/confirm-password')
22+
->waitForText('Please confirm your password before continuing.')
2223
->assertInputPresent('password');
2324
});
2425
}
@@ -30,6 +31,7 @@ public function test_password_can_be_confirmed()
3031

3132
$browser->loginAs($user)
3233
->visit('/confirm-password')
34+
->waitForText('Please confirm your password before continuing.')
3335
->type('password', 'password')
3436
->press('Confirm')
3537
->waitForLocation(RouteServiceProvider::HOME)
@@ -44,6 +46,7 @@ public function test_password_is_not_confirmed_with_invalid_password()
4446

4547
$browser->loginAs($user)
4648
->visit('/confirm-password')
49+
->waitForText('Please confirm your password before continuing.')
4750
->type('password', 'wrong-password')
4851
->press('Confirm')
4952
->waitForText('The provided password is incorrect.')

stubs/splade/dusk-tests/Auth/PasswordResetTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public function test_password_can_be_reset_with_valid_token()
6868

6969
$browser->logout()
7070
->visit('/forgot-password')
71+
->waitForText('Forgot your password?')
7172
->type('email', $user->email)
7273
->press('Email Password Reset Link')
7374
->waitForText('We have emailed your password reset link!');

stubs/splade/dusk-tests/Auth/PasswordUpdateTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public function test_password_can_be_updated()
1919
$this->browse(function (Browser $browser) use ($user) {
2020
$browser->loginAs($user)
2121
->visit('/profile')
22+
->waitForText('Update Password')
2223
->within('@update-password', function (Browser $browser) {
2324
$browser->type('current_password', 'password')
2425
->type('password', 'new-password')
@@ -38,6 +39,7 @@ public function test_correct_password_must_be_provided_to_update_password()
3839
$this->browse(function (Browser $browser) use ($user) {
3940
$browser->loginAs($user)
4041
->visit('/profile')
42+
->waitForText('Update Password')
4143
->within('@update-password', function (Browser $browser) {
4244
$browser->type('current_password', 'wrong-password')
4345
->type('password', 'new-password')

stubs/splade/dusk-tests/Auth/RegistrationTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public function test_registration_screen_can_be_rendered()
1616
$this->browse(function (Browser $browser) {
1717
$browser->logout()
1818
->visit('/register')
19+
->waitForInput('name')
1920
->assertInputPresent('name')
2021
->assertInputPresent('email')
2122
->assertInputPresent('password')
@@ -28,6 +29,7 @@ public function test_new_users_can_register()
2829
$this->browse(function (Browser $browser) {
2930
$browser->logout()
3031
->visit('/register')
32+
->waitForInput('name')
3133
->type('name', 'Test User')
3234
->type('email', 'test@example.com')
3335
->type('password', 'password')

stubs/splade/dusk-tests/ProfileTest.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public function test_profile_page_is_displayed()
1818

1919
$browser->loginAs($user)
2020
->visit('/profile')
21+
->waitForText('Profile Information')
2122
->assertInputPresent('current_password');
2223
});
2324
}
@@ -29,6 +30,7 @@ public function test_profile_information_can_be_updated()
2930
$this->browse(function (Browser $browser) use ($user) {
3031
$browser->loginAs($user)
3132
->visit('/profile')
33+
->waitForText('Profile Information')
3234
->within('@update-profile-information', function (Browser $browser) {
3335
$browser->type('name', 'Test User')
3436
->type('email', 'test@example.com')
@@ -51,6 +53,7 @@ public function test_email_verification_status_is_unchanged_when_the_email_addre
5153
$this->browse(function (Browser $browser) use ($user) {
5254
$browser->loginAs($user)
5355
->visit('/profile')
56+
->waitForText('Profile Information')
5457
->within('@update-profile-information', function (Browser $browser) use ($user) {
5558
$browser->type('name', 'Test User')
5659
->type('email', $user->email)
@@ -71,16 +74,17 @@ public function test_user_can_delete_their_account()
7174
$this->browse(function (Browser $browser) use ($user) {
7275
$browser->loginAs($user)
7376
->visit('/profile')
77+
->waitForText('Delete Account')
7478
->scrollTo('@delete-user')
75-
->click('@open-delete-modal')
76-
->waitFor('@confirm-user-deletion')
77-
->within('@confirm-user-deletion', function (Browser $browser) {
78-
$browser->waitForText('Are you sure')
79+
->press('Delete Account')
80+
->waitForText('Are you sure you want to delete your account?')
81+
->within('#headlessui-portal-root', function (Browser $browser) {
82+
$browser
7983
->type('password', 'wrong_password')
80-
->press('@confirm-delete-account')
81-
->waitForText('The password is incorrect.')
84+
->press('Delete Account')
85+
->waitForText('The provided password is incorrect.')
8286
->type('password', 'password')
83-
->press('@confirm-delete-account')
87+
->press('Delete Account')
8488
->waitForLocation('/')
8589
->assertGuest();
8690
});

0 commit comments

Comments
 (0)