diff --git a/src/CustomLivewireAssertionsMixin.php b/src/CustomLivewireAssertionsMixin.php index be09e8e..984981f 100644 --- a/src/CustomLivewireAssertionsMixin.php +++ b/src/CustomLivewireAssertionsMixin.php @@ -15,7 +15,7 @@ public function assertPropertyWired(): Closure { return function (string $property) { PHPUnit::assertMatchesRegularExpression( - '/wire:model(\.(live|(lazy|debounce)(\.\d+?(ms|s)|)))*=(?"|\')'.$property.'(\k\'q\')/', + '/wire:model(\.(live|blur|(lazy|debounce)(\.\d+?(ms|s)|)))*=(?"|\')'.$property.'(\k\'q\')/', $this->html() ); @@ -30,7 +30,7 @@ public function assertPropertyNotWired(): Closure { return function (string $property) { PHPUnit::assertDoesNotMatchRegularExpression( - '/wire:model(\.(live|(lazy|debounce)(\.\d+?(ms|s)|)))*=(?"|\')'.$property.'(\k\'q\')/', + '/wire:model(\.(live|blur|(lazy|debounce)(\.\d+?(ms|s)|)))*=(?"|\')'.$property.'(\k\'q\')/', $this->html() ); diff --git a/tests/AssertionsTest.php b/tests/AssertionsTest.php index 881fc64..04db3cd 100644 --- a/tests/AssertionsTest.php +++ b/tests/AssertionsTest.php @@ -25,6 +25,7 @@ public function it_checks_if_livewire_property_is_wired_to_a_field(): void { Livewire::test(LivewireTestComponentA::class) ->assertPropertyWired('user') + ->assertPropertyWired('blur') ->assertPropertyWired('lazy') ->assertPropertyWired('live') ->assertPropertyWired('debounce') @@ -39,6 +40,7 @@ public function it_checks_if_livewire_property_is_not_wired_to_a_field(): void { Livewire::test(LivewireTestComponentA::class) ->assertPropertyNotWired('user_not_wired') + ->assertPropertyNotWired('blur_not_wired') ->assertPropertyNotWired('lazy_not_wired') ->assertPropertyNotWired('live_not_wired') ->assertPropertyNotWired('debounce_not_wired') diff --git a/tests/resources/views/livewire-test-component-a.php b/tests/resources/views/livewire-test-component-a.php index 6f391e4..405efc0 100644 --- a/tests/resources/views/livewire-test-component-a.php +++ b/tests/resources/views/livewire-test-component-a.php @@ -1,5 +1,6 @@
+