mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-30 03:25:59 +00:00
Searching backend
This commit is contained in:
@@ -2,10 +2,10 @@
|
||||
|
||||
namespace Tests\Feature\Oasis;
|
||||
|
||||
use App\Models\Oasis\Client;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use App\Models\Oasis\Client;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use App\Models\User;
|
||||
use Tests\TestCase;
|
||||
|
||||
class OasisClientTest extends TestCase
|
||||
@@ -45,4 +45,32 @@ class OasisClientTest extends TestCase
|
||||
'id' => $client->id,
|
||||
])->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_search_user_client()
|
||||
{
|
||||
$user = User::factory(User::class)
|
||||
->create(['role' => 'user']);
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
|
||||
$client = Client::factory(Client::class)
|
||||
->create([
|
||||
'user_id' => $user->id,
|
||||
'name' => 'VueFileManager Inc.',
|
||||
'email' => 'info@company.com',
|
||||
]);
|
||||
|
||||
$this->getJson('/api/oasis/clients/search?query=vue')
|
||||
->assertJsonFragment([
|
||||
'id' => $client->id,
|
||||
])->assertStatus(200);
|
||||
|
||||
$this->getJson('/api/oasis/clients/search?query=info')
|
||||
->assertJsonFragment([
|
||||
'id' => $client->id,
|
||||
])->assertStatus(200);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user