christophrumpel / missing-livewire-assertions

Adding the missing Livewire assertions to your Laravel project
MIT License
136 stars 25 forks source link

`assertMethodWired` does not work with `wire:click.prevent` #5

Closed dostrog closed 3 years ago

dostrog commented 3 years ago

When we use something like this (pay attention on .prevent with click):

<x-jet-danger-button wire:key="del-actions" wire:click.prevent="delete" onclick="confirm('Remove car \\'{{ $car->name }}\\'.\nAre you sure?') || event.stopImmediatePropagation()" wire:loading.attr="disabled">
    <x-far-trash-alt wire:loading.remove wire:target="delete" class="-ml-0.5 mr-2 h-4 w-4" />
    <x-fas-spinner wire:loading wire:target="delete" class="-ml-0.5 mr-2 h-4 w-4 animate-spin" />
    {{ __('Delete car') }}
</x-jet-danger-button>

assertion

...
$component->assertMethodWired('delete');
...

does not work.

christophrumpel commented 3 years ago

Hey @dostrog, thanks, I added support for that in the new version v0.2.3.. 👍

dostrog commented 3 years ago

Thanx!