Replies: 1 comment
-
Hi @leeuweriq. Instead of changing your |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When testing a full page Livewire component (ie Livewire::test(LoginComponent::class)), I get a
Illuminate\View\ViewException
saying:Illuminate\View\ViewException : View [login] not found. (View: /[my-project-folder]/vendor/livewire/livewire/src/views/mount-component.blade.php)
This is probably because I created a tenant task to change the default views path, depending on the selected tenant:
In the setup() of my test I create an account (which extends the Tenant class) and I make that account 'active':
$this->account->makeCurrent();
Using Ray I can see that the related tasks are being triggered when running the test.
However what Livewire::test seem to be doing is registering its own routes before existing routes are registered (see
TestableLivewire::155
) and in that process the tenant middleware seems to be ignored completely. Also setting the view path explicitly in the test method before callingLivewire::test
doesn't seem to resolve the issue:This way I am unable to properly test my Livewire components. Is there a way to fix this?
Using:
laravel/framework 10.17.1
livewire/livewire v2.12.5
spatie/laravel-multitenancy 3.0.3
Beta Was this translation helpful? Give feedback.
All reactions