Dec 23, 2021
0
Level 9
Test "assertSeeLivewire" not working properly
I am following the "buiild a voting app" course. I have built many tests already, but suddenly I ran into problems and I can't understand why.
Typically when I have a assertion like this:
$this->actingAs($user)
->get(route('idea.show', $idea))
->assertSeeLivewire('edit-comment');
I get the error message (when running the test):
at C:\Projects\htdocs\lc-voting\vendor\livewire\livewire\src\LivewireServiceProvider.php:183
179▕
180▕ \PHPUnit\Framework\Assert::assertStringContainsString(
181▕ $escapedComponentName,
182▕ $this->getContent(),
➜ 183▕ 'Cannot find Livewire component ['.$component.'] rendered on page.'
184▕ );
185▕
186▕ return $this;
187▕ });
1 C:\Projects\htdocs\lc-voting\vendor\laravel\framework\src\Illuminate\Macroable\Traits\Macroable.php:124
Illuminate\Testing\TestResponse::Livewire\{closure}("edit-comment")
2 C:\Projects\htdocs\lc-voting\tests\Feature\Comments\DeleteCommentTest.php:27
Illuminate\Testing\TestResponse::__call("assertSeeLivewire")
All my test which use assertSeeLivewire have this problem, while they were functioning properly before.
Any suggestions?
Please or to participate in this conversation.