Livewire in Tests

What seems to be the problem:
I’m trying to create a test to ensure only users with the correct permission can create a model via the Livewire class. The Create test works great if the user has the correct permission, however I also want a test verifying it won’t create with incorrect permissions. I run this test, and simply receive Undefined index: fingerprint.

Are you using the latest version of Livewire:
yes

public function mount()
{

    $this->authorize('create property');

}

Hey, @bdbolin
Can you share your full code?

Or maybe you want to see this

Hey @skywalker - I figured it out after looking at this: https://github.com/livewire/livewire/issues/837

I was still trying to set the values before my ->assertForbidden();
That leads to the “Undefined index: fingerprint” error. So the fix was removing my set and my call on the Livewire component:

Livewire::test(ModelForm::class)
->set(‘name’, 'Chewy)
->set(‘status’, ‘active’)
->set(‘address’, ‘address’)
->call(‘submit’)
->assertForbidden();

Would you mind explaining why it wouldn’t work? Or where that error comes from? Thanks!