-
Notifications
You must be signed in to change notification settings - Fork 44
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
Showing
7 changed files
with
97 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Laravel\Nova\Tests\Browser; | ||
|
||
use Laravel\Dusk\Browser; | ||
use Laravel\Nova\Testing\Browser\Components\Controls\RelationSelectControlComponent; | ||
use Laravel\Nova\Testing\Browser\Components\FormComponent; | ||
use Laravel\Nova\Testing\Browser\Pages\Attach; | ||
use Laravel\Nova\Tests\DuskTestCase; | ||
|
||
class DependentBelongsToManyFieldTest extends DuskTestCase | ||
{ | ||
public function test_it_can_listen_to_related_field_changes() | ||
{ | ||
$this->browse(function (Browser $browser) { | ||
$browser->loginAs(1) | ||
->visit(new Attach('users', 1, 'books', 'personalBooks')) | ||
->within(new FormComponent(), function ($browser) { | ||
$browser->assertSee('Attach Book') | ||
->assertSeeIn('p.help-text', 'Price starts from $0-$99') | ||
->within(new RelationSelectControlComponent('attachable'), function ($browser) { | ||
$browser->select('', 1); | ||
})->pause(500) | ||
->assertSeeIn('p.help-text', 'Price starts from $10-$199'); | ||
}); | ||
}); | ||
} | ||
} |
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