-
-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ee0a05e
commit 890e8e1
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Tests\Browser; | ||
|
||
use App\Models\User; | ||
use Illuminate\Foundation\Testing\DatabaseMigrations; | ||
use Illuminate\Support\Facades\Hash; | ||
use Laravel\Dusk\Browser; | ||
use Tests\DuskTestCase; | ||
|
||
class DeleteUserTest extends DuskTestCase | ||
{ | ||
public function testSuccess(): void | ||
{ | ||
$password = 'hoi'; | ||
|
||
$user = factory(User::class)->create([ | ||
'password' => Hash::make($password) | ||
]); | ||
|
||
$this->browse(function (Browser $browser) use ($user, $password) { | ||
$browser | ||
->assertGuest() | ||
->visit('/login') | ||
->type('email', $user->email) | ||
->type('password', $password) | ||
->press('Log in') | ||
->assertAuthenticated() | ||
->visit('/settings/account') | ||
->press('Delete') | ||
->press('Yes, I am sure') | ||
->assertGuest(); | ||
}); | ||
} | ||
} |