Resolve #3269
This commit is contained in:
@@ -81,7 +81,7 @@ final class CreateComponentCommand
|
|||||||
*/
|
*/
|
||||||
public $rules = [
|
public $rules = [
|
||||||
'name' => 'required|string',
|
'name' => 'required|string',
|
||||||
'description' => 'required|string',
|
'description' => 'nullable|string',
|
||||||
'status' => 'required|int|min:0|max:4',
|
'status' => 'required|int|min:0|max:4',
|
||||||
'link' => 'nullable|url',
|
'link' => 'nullable|url',
|
||||||
'order' => 'nullable|int',
|
'order' => 'nullable|int',
|
||||||
|
|||||||
@@ -84,6 +84,21 @@ class ComponentTest extends AbstractApiTestCase
|
|||||||
$response->assertJsonFragment(['name' => 'Foo']);
|
$response->assertJsonFragment(['name' => 'Foo']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function test_can_create_minimal_component()
|
||||||
|
{
|
||||||
|
$this->beUser();
|
||||||
|
|
||||||
|
$this->expectsEvents(ComponentWasCreatedEvent::class);
|
||||||
|
|
||||||
|
$response = $this->json('POST', '/api/v1/components', [
|
||||||
|
'name' => 'Foo',
|
||||||
|
'status' => 1,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$response->assertStatus(200);
|
||||||
|
$response->assertJsonFragment(['name' => 'Foo']);
|
||||||
|
}
|
||||||
|
|
||||||
public function test_can_create_component_without_enabled_field()
|
public function test_can_create_component_without_enabled_field()
|
||||||
{
|
{
|
||||||
$this->beUser();
|
$this->beUser();
|
||||||
|
|||||||
Reference in New Issue
Block a user