write test for safety and privacy controller
This commit is contained in:
50
tests/Feature/V2/Dashboard/SafetyAndPrivacy/DetailTest.php
Normal file
50
tests/Feature/V2/Dashboard/SafetyAndPrivacy/DetailTest.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature\V2\Dashboard\SafetyAndPrivacy;
|
||||
|
||||
use App\Models\LogList;
|
||||
use App\Models\Permission;
|
||||
use App\Models\SafetyAndPrivacy;
|
||||
use App\Models\User;
|
||||
use App\Models\UserActivityLog;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Tests\TestCase;
|
||||
|
||||
class DetailTest extends TestCase
|
||||
{
|
||||
use RefreshDatabase, WithFaker;
|
||||
/**
|
||||
* A basic feature test example.
|
||||
*/
|
||||
public function test_can_see_a_safety_and_privacy_detail(): void
|
||||
{
|
||||
$safetyAndPrivacy = SafetyAndPrivacy::factory()->create();
|
||||
|
||||
$user = User::factory()
|
||||
->create();
|
||||
|
||||
$response = $this->actingAs($user)->getJson("v2/safety_and_privacy/{$safetyAndPrivacy->id}");
|
||||
|
||||
$response->assertStatus(200)
|
||||
->assertJsonStructure([
|
||||
'id',
|
||||
'lat',
|
||||
'lon',
|
||||
'province_id',
|
||||
'province_fa',
|
||||
'city_id',
|
||||
'city_fa',
|
||||
'edare_shahri_id',
|
||||
'edare_shahri_name',
|
||||
'recognize_picture',
|
||||
'activity_date_time',
|
||||
'judiciary_document',
|
||||
'judiciary_document_upload_date',
|
||||
'action_picture',
|
||||
'info_id',
|
||||
'info_fa',
|
||||
'way_id'
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user