longestdrive's avatar

Jetstream failing tests installed in a new laravel 10 install

I have a new laravel 10 project and installed Jetstream as a skeleton which in turn uses Livewire. Setting up my testing environment (in Docker and Phpstorm - which is a pain) but when running tests using Sail Test I get failures which appear to be in the package view files:

Unresolvable dependency resolving [Parameter #0 [ <required> string $name ]] in class BladeUIKit\Components\Forms\Inputs\Input (View: /var/www/html/resources/views/profile/update-password-form.blade.php) (View: /var/www/html/resources/views/profile/update-password-form.blade.php)

I published the package files, migrated the database etc so all should be set up

The test is:

public function test_password_can_be_updated(): void
    {
        $this->actingAs($user = User::factory()->create());

        Livewire::test(UpdatePasswordForm::class)
                ->set('state', [
                    'current_password' => 'password',
                    'password' => 'new-password',
                    'password_confirmation' => 'new-password',
                ])
                ->call('updatePassword');

        $this->assertTrue(Hash::check('new-password', $user->fresh()->password));
    }

So a user is being created - but not passed to the view

If I then go to the view in the browser - same issue - the $name variable is not present.

Have I missed an install step - i think I've followed everything but can't see where to modify the code to include $name (in a view composer?) from the base package whilst it's all in the vendor folder

What have I missed?

0 likes
3 replies
longestdrive's avatar

@jaseofspades88 HI - I hadnt seen that guidance - just reviewed, although it's for upgrading I can't see any additional steps from the fresh install - something amiss in Livewire I think

longestdrive's avatar
longestdrive
OP
Best Answer
Level 4

Ok - I re-installed the package and the error was still there. I then removed a blade-UI package I had installed and it appears that's where a conflict between packages was being created.

Removed that package and it's now working as expected

The package was : blade-ui-kit/blade-ui-kit

Please or to participate in this conversation.