Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Aug 8, 2024
1 parent ec600f3 commit 59b4533
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/Browser/CreateWithInlineRelationButtonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
});
});
Expand Down
22 changes: 22 additions & 0 deletions tests/Browser/UpdateWithBelongsToTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
}

0 comments on commit 59b4533

Please sign in to comment.