-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update dependencies to laravel 8 * Update minim PHP version * Update factories to laravel 8 * Fix dusk tests * Remove auth routes comment * Style * Readme update * Readme update * Update factory on feature test * Add import * Update user import * Update seeders path * update variable name Co-authored-by: Manel Gavaldà <[email protected]>
- Loading branch information
1 parent
ad8d2b9
commit c8618fc
Showing
10 changed files
with
41 additions
and
25 deletions.
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
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
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
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
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ | |
use Illuminate\Support\Facades\Auth; | ||
use Illuminate\Support\Facades\Hash; | ||
use Illuminate\Foundation\Testing\DatabaseMigrations; | ||
use App\Models\User; | ||
|
||
/** | ||
* Class AcachaAdmintLTELaravelTest. | ||
|
@@ -53,7 +54,8 @@ private function logout() | |
public function testLandingPageWithUserLogged() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$user = factory(\App\User::class)->create(); | ||
$user = User::factory()->create(); | ||
|
||
$browser->loginAs($user) | ||
->visit('/') | ||
->assertSee('Acacha') | ||
|
@@ -87,7 +89,8 @@ public function testLoginPage() | |
public function testLogin() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$user = factory(\App\User::class)->create(['password' => Hash::make('passw0RD')]); | ||
$user = User::factory()->create(['password' => Hash::make('passw0RD')]); | ||
|
||
$browser->visit('/login') | ||
->type('email', $user->email) | ||
->type('password', 'passw0RD') | ||
|
@@ -168,12 +171,13 @@ public function testLoginCredentialsNotMatchDissappearsOnKeyDown() | |
{ | ||
$this->browse(function (Browser $browser) { | ||
$browser->visit('/login') | ||
->waitFor("[name='email']") | ||
->type('email', '[email protected]') | ||
->type('password', '12345678') | ||
->press('Sign In') | ||
->pause(1000) | ||
->type('password', '1') | ||
->pause(1000) | ||
->pause(2000) | ||
->assertDontSee('These credentials do not match our records'); | ||
}); | ||
} | ||
|
@@ -186,18 +190,21 @@ public function testLoginCredentialsNotMatchDissappearsOnKeyDown() | |
public function testLoginWithRememberMe() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$user = factory(\App\User::class)->create(['password' => Hash::make('passw0RD')]); | ||
$user = User::factory()->create(['password' => Hash::make('passw0RD')]); | ||
|
||
$browser->visit('/login') | ||
->type('email', $user->email) | ||
->type('password', 'passw0RD') | ||
->script("$('input[name=remember]').iCheck('check');"); | ||
|
||
$browser->press('Sign In') | ||
->waitFor('#result') | ||
->pause(5000) | ||
->assertPathIs('/home') | ||
->assertHasCookie(Auth::getRecallerName()) | ||
->assertSee($user->name); | ||
}); | ||
|
||
$this->logout(); | ||
} | ||
|
||
|
@@ -235,8 +242,10 @@ public function testPasswordResetPage() | |
public function testHomePageForUnauthenticatedUsers() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$user = factory(\App\User::class)->create(); | ||
$user = User::factory()->create(); | ||
|
||
view()->share('user', $user); | ||
|
||
$browser->visit('/home') | ||
->pause(2000) | ||
->assertPathIs('/login'); | ||
|
@@ -251,8 +260,10 @@ public function testHomePageForUnauthenticatedUsers() | |
public function testHomePageForAuthenticatedUsers() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$user = factory(\App\User::class)->create(); | ||
$user = User::factory()->create(); | ||
|
||
view()->share('user', $user); | ||
|
||
$browser->loginAs($user) | ||
->visit('/home') | ||
->assertSee($user->name); | ||
|
@@ -269,8 +280,10 @@ public function testHomePageForAuthenticatedUsers() | |
public function testLogout() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$user = factory(\App\User::class)->create(); | ||
$user = User::factory()->create(); | ||
|
||
view()->share('user', $user); | ||
|
||
$browser->loginAs($user) | ||
->visit('/home') | ||
->click('#user_menu') | ||
|
@@ -376,7 +389,8 @@ public function testNewUserRegistrationRequiredFieldsDissappearsOnKeyDown() | |
public function testSendPasswordReset() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$user = factory(\App\User::class)->create(); | ||
$user = User::factory()->create(); | ||
|
||
$browser->visit('password/reset') | ||
->type('email', $user->email) | ||
->press('Send Password Reset Link') | ||
|
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