Level 73
And in your StoreAttribute Component do you have
protected $rules = [
'type' => 'in:option1,option2',
];
?
1 like
Summer Sale! All accounts are 50% off this week.
it('requires one of the value from an array', function () {
$this->actingAs(User::first())
->livewire(StoreAttribute::class)
->set('name', 'Color')
->set('type', 'option6')
->call('store')
->assertHasErrors(['type' => 'in:option1,option2']);
});
I try to assert the following code, but the assertion is unsuccessful.
Component has no [in:option1,option2] errors for [type] attribute.
Failed asserting that an array contains In:option1,option2.
Skip the options
->assertHasErrors(['type' => 'in']);
Please or to participate in this conversation.