mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
27 lines
846 B
PHP
27 lines
846 B
PHP
|
<?php
|
||
|
|
||
|
use App\Models\User;
|
||
|
use Laravel\Jetstream\Http\Livewire\UpdateProfileInformationForm;
|
||
|
use Livewire\Livewire;
|
||
|
|
||
|
test('current profile information is available', function () {
|
||
|
$this->actingAs($user = User::factory()->create());
|
||
|
|
||
|
$component = Livewire::test(UpdateProfileInformationForm::class);
|
||
|
|
||
|
expect($component->state['name'])->toEqual($user->name);
|
||
|
expect($component->state['email'])->toEqual($user->email);
|
||
|
});
|
||
|
|
||
|
test('profile information can be updated', function () {
|
||
|
$this->actingAs($user = User::factory()->create());
|
||
|
|
||
|
Livewire::test(UpdateProfileInformationForm::class)
|
||
|
->set('state', ['name' => 'Test Name', 'email' => 'test@example.com'])
|
||
|
->call('updateProfileInformation');
|
||
|
|
||
|
expect($user->fresh())
|
||
|
->name->toEqual('Test Name')
|
||
|
->email->toEqual('test@example.com');
|
||
|
});
|