write test for the lists

This commit is contained in:
2024-12-18 13:03:42 +03:30
parent d2d433f2b7
commit b8f5ed10ba
4 changed files with 85 additions and 3 deletions

View File

@@ -24,17 +24,17 @@ class SupervisorIndexTest extends TestCase
$response->assertForbidden();
}
public function test_operator_can_see_the_data_table(): void
public function test_supervisor_can_see_the_data_table(): void
{
$user = User::factory()
->has(Permission::factory([
'name' => 'create-road-item'
'name' => 'show-road-item-supervise-cartable'
]))
->create();
RoadItemsProject::factory(10)->create();
$response = $this->actingAs($user)->getJson(route('v3.road_items.operatorIndex', [
$response = $this->actingAs($user)->getJson(route('v3.road_items.supervisorIndex', [
'size' => 10,
'start' => 0,
'sorting' => json_encode([]),
@@ -90,6 +90,7 @@ class SupervisorIndexTest extends TestCase
"cmms_machine_code",
"rahdar_id",
"rahdar_code",
"can_supervise",
],
]
]);