write test for safety and privacy controller

This commit is contained in:
2024-03-09 15:46:27 +03:30
parent 7ab6fd3d09
commit 8d8f45d950
6 changed files with 377 additions and 1 deletions

View File

@@ -0,0 +1,41 @@
<?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 getAllDataToMapTest extends TestCase
{
use RefreshDatabase, WithFaker;
/**
* A basic feature test example.
*/
public function test_can_see_all_data_to_map(): void
{
$date_from = $this->faker->date;
$date_to = $this->faker->date;
$user = User::factory()
->create();
$response = $this->actingAs($user)->getJson(route('v2.safety_and_privacy.report.map', [
'date_from' => $date_from,
'date_to' => $date_to
]));
$response->assertStatus(200)
->assertJsonStructure([
'status',
'count',
'message',
'data'
]);
}
}