Migrate to HTMX (#114)

Dropped Livewire
Added HTMX
Added Blade code lint
Drop Mysql and Redis
Migrate to SQLite
This commit is contained in:
Saeed Vaziry
2024-03-06 17:02:59 +01:00
committed by GitHub
parent 5b2c419e91
commit b2083fc6b2
486 changed files with 8609 additions and 8707 deletions

View File

@ -2,10 +2,8 @@
namespace Tests\Feature;
use App\Http\Livewire\Profile\UpdatePassword;
use App\Http\Livewire\Profile\UpdateProfileInformation;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Livewire\Livewire;
use Illuminate\Support\Facades\Hash;
use Tests\TestCase;
class ProfileTest extends TestCase
@ -18,20 +16,20 @@ public function test_profile_page_is_displayed(): void
$this
->get(route('profile'))
->assertSeeLivewire(UpdateProfileInformation::class)
->assertSeeLivewire(UpdatePassword::class);
->assertSee('Profile Information')
->assertSee('Update Password')
->assertSee('Two Factor Authentication');
}
public function test_profile_information_can_be_updated(): void
{
$this->actingAs($this->user);
Livewire::test(UpdateProfileInformation::class)
->set('name', 'Test')
->set('email', 'test@example.com')
->set('timezone', 'Europe/Berlin')
->call('submit')
->assertSuccessful();
$this->post(route('profile.info'), [
'name' => 'Test',
'email' => 'test@example.com',
'timezone' => 'Europe/Berlin',
]);
$this->user->refresh();
@ -39,4 +37,28 @@ public function test_profile_information_can_be_updated(): void
$this->assertSame('test@example.com', $this->user->email);
$this->assertSame('Europe/Berlin', $this->user->timezone);
}
public function test_password_can_be_updated(): void
{
$this->actingAs($this->user);
$this->post(route('profile.password'), [
'current_password' => 'password',
'password' => 'new-password',
'password_confirmation' => 'new-password',
]);
$this->assertTrue(Hash::check('new-password', $this->user->refresh()->password));
}
public function test_correct_password_must_be_provided_to_update_password(): void
{
$this->actingAs($this->user);
$this->post(route('profile.password'), [
'current_password' => 'wrong-password',
'password' => 'new-password',
'password_confirmation' => 'new-password',
])->assertSessionHasErrors('current_password');
}
}