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

@ -3,29 +3,29 @@
namespace Tests\Feature;
use App\Enums\StorageProvider;
use App\Http\Livewire\StorageProviders\ConnectProvider;
use App\Http\Livewire\StorageProviders\ProvidersList;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Http;
use Livewire\Livewire;
use JsonException;
use Tests\TestCase;
class StorageProvidersTest extends TestCase
{
use RefreshDatabase;
/**
* @throws JsonException
*/
public function test_connect_dropbox(): void
{
$this->actingAs($this->user);
Http::fake();
Livewire::test(ConnectProvider::class)
->set('provider', StorageProvider::DROPBOX)
->set('name', 'profile')
->set('token', 'token')
->call('connect')
->assertSuccessful();
$this->post(route('storage-providers.connect'), [
'provider' => StorageProvider::DROPBOX,
'name' => 'profile',
'token' => 'token',
])->assertSessionHasNoErrors();
$this->assertDatabaseHas('storage_providers', [
'provider' => StorageProvider::DROPBOX,
@ -42,12 +42,13 @@ public function test_see_providers_list(): void
'provider' => StorageProvider::DROPBOX,
]);
Livewire::test(ProvidersList::class)
->assertSee([
$provider->profile,
]);
$this->get(route('storage-providers'))
->assertSee($provider->profile);
}
/**
* @throws JsonException
*/
public function test_delete_provider(): void
{
$this->actingAs($this->user);
@ -56,10 +57,8 @@ public function test_delete_provider(): void
'user_id' => $this->user->id,
]);
Livewire::test(ProvidersList::class)
->set('deleteId', $provider->id)
->call('delete')
->assertSuccessful();
$this->delete(route('storage-providers.delete', $provider->id))
->assertSessionHasNoErrors();
$this->assertDatabaseMissing('storage_providers', [
'id' => $provider->id,