it('can create a customer', function () {
$customer = Customer::factory()->make();
livewire(CreateCustomer::class)
->fillForm([
'type' => $customer->type,
'first_name' => $customer->first_name,
'last_name' => $customer->last_name,
])
->call('create')
->assertHasNoFormErrors();
assertDatabaseHas('customers', [
'type' => $customer->type,
'first_name' => $customer->first_name,
'last_name' => $customer->last_name,
]);
});
it('can create a customer', function () {
$customer = Customer::factory()->make();
livewire(CreateCustomer::class)
->fillForm([
'type' => $customer->type,
'first_name' => $customer->first_name,
'last_name' => $customer->last_name,
])
->call('create')
->assertHasNoFormErrors();
assertDatabaseHas('customers', [
'type' => $customer->type,
'first_name' => $customer->first_name,
'last_name' => $customer->last_name,
]);
});