create(); $response = $this->get(route('custom-field.index'), [ 'group' => config("custom-field.groups")[array_rand(config("custom-field.groups"))] ]); $response->assertStatus(200) ->assertJsonStructure([ 'data' => [ '*' => [ 'id', 'key', 'group', 'label', 'options', 'type', 'required', ] ] ]); } public function test_custom_field_save(): void { $form = CustomField::factory()->make(); $response = $this->postJson(route('custom-field.store'), $form->toArray()); $response->assertStatus(201); } public function test_custom_groups(): void { $response = $this->get(route('custom-field.groups')); $response->assertStatus(200)->assertJsonCount(count(config("custom-field.groups")), "data"); } }