diff --git a/tests/Browser/CreateWithInlineRelationButtonTest.php b/tests/Browser/CreateWithInlineRelationButtonTest.php index 96833387..5a9332e9 100644 --- a/tests/Browser/CreateWithInlineRelationButtonTest.php +++ b/tests/Browser/CreateWithInlineRelationButtonTest.php @@ -74,10 +74,10 @@ public function test_searchable_belongs_to_resource_can_be_cancelled_and_use_dif ->resetSearchResult() ->assertSearchResult(function ($browser, $attribute) { $browser->assertSeeIn("{$attribute}-results", 'Ship name') - ->assertPresent("{$attribute}-result-1") - ->assertPresent("{$attribute}-result-2") - ->assertPresent("{$attribute}-result-3") - ->assertPresent("{$attribute}-result-4"); + ->assertNotPresent("{$attribute}-result-1") + ->assertNotPresent("{$attribute}-result-2") + ->assertNotPresent("{$attribute}-result-3") + ->assertNotPresent("{$attribute}-result-4"); }); }); }); diff --git a/tests/Browser/UpdateWithBelongsToTest.php b/tests/Browser/UpdateWithBelongsToTest.php index 79c40ff8..01eb0b5f 100755 --- a/tests/Browser/UpdateWithBelongsToTest.php +++ b/tests/Browser/UpdateWithBelongsToTest.php @@ -138,4 +138,26 @@ public function test_belongs_to_field_should_ignore_query_parameters_when_editin $browser->blank(); }); } + + public function test_searchable_resource_can_be_cleared_without_fetching_all_records() + { + $this->defineApplicationStates('searchable'); + + $post = PostFactory::new()->create([ + 'user_id' => 4, + ]); + + $this->browse(function (Browser $browser) use ($post) { + $browser->loginAs(1) + ->visit(new Update('posts', $post->id)) + ->within(new FormComponent(), function ($browser) { + $browser->assertSelectedSearchResult('users', 'Laravel Nova') + ->click('@users-search-input-clear-button') + ->pause(1500) + ->assertEmptySearchResult('users'); + }); + + $browser->blank(); + }); + } }