@@ -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