From 17a6335d133ad59acd2289fc8541cb2a6a44b679 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 3 Jul 2024 22:12:06 +0100 Subject: [PATCH] Added test Signed-off-by: snipe --- tests/Feature/Users/Api/UserSearchTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Feature/Users/Api/UserSearchTest.php b/tests/Feature/Users/Api/UserSearchTest.php index 2b1d557970..fba18e67ea 100644 --- a/tests/Feature/Users/Api/UserSearchTest.php +++ b/tests/Feature/Users/Api/UserSearchTest.php @@ -144,4 +144,15 @@ class UserSearchTest extends TestCase 'User index contains unexpected user from another company' ); } + + public function testUsersIndexWhenInvalidSortFieldIsPassed() + { + $this->actingAsForApi(User::factory()->viewUsers()->create()) + ->getJson(route('api.users.index', [ + 'sort' => 'assets', + ])) + ->assertOk() + ->assertStatus(200) + ->json(); + } }