create(); $response = $this->actingAs($user)->getJson(route('v3.road_items.operatorIndex')); $response->assertForbidden(); } public function test_operator_can_see_the_data_table(): void { $user = User::factory() ->has(Permission::factory([ 'name' => 'create-road-item' ])) ->create(); RoadItemsProject::factory(10)->create(); $response = $this->actingAs($user)->getJson(route('v3.road_items.operatorIndex', [ 'size' => 10, 'start' => 0, 'sorting' => json_encode([]), 'filters' => json_encode([]), ])); $response->assertOk(); $response->assertJsonStructure([ 'data' => [ '*' => [ "id", "user_id", "start_lat", "start_lng", "end_lat", "end_lng", "project_distance", "item", "item_fa", "sub_item", "sub_item_fa", "sub_item_data", "sub_items", "sub_items_data", "created_at", "updated_at", "province_id", "province_fa", "city_id", "city_fa", "is_new", "parent_id", "start_way_id", "end_way_id", "unit_fa", "user_name", "created_at_fa", "info_id", "status", "status_fa", "edarat_id", "edarat_name", "edarat_type", "activity_date", "activity_time", "activity_date_time", "supervisor_id", "supervisor_name", "supervisor_description", "supervising_time", "cmms_machine_id", "cmms_machine_code", "rahdar_id", "rahdar_code", ], ] ]); } }