-
-
Save uno-de-piera/c2f916057a1807297689ed4dcfc804b2 to your computer and use it in GitHub Desktop.
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
<?php | |
public function testDatatablesSearchable() | |
{ | |
factory(User::class, 10)->create(); | |
$userToLogin = User::find(2); | |
$userToSearch = User::find(8); | |
$this->browse(function (Browser $browser) use($userToLogin, $userToSearch) | |
{ | |
$browser->loginAs($userToLogin) | |
->visit('/users/datatables') | |
->pause(1000) //peticiones ajax | |
->with('.table', function ($table) use ($userToSearch) | |
{ | |
$table->assertDontSee($userToSearch->email); | |
}) | |
->type('input[type=search]', $userToSearch->name) | |
->pause(500) | |
->with('.table', function (Browser $table) use ($userToSearch) | |
{ | |
$table->assertSee($userToSearch->email); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment