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,15 +3,11 @@
namespace Tests\Feature;
use App\Enums\SshKeyStatus;
use App\Http\Livewire\ServerSshKeys\AddExistingKey;
use App\Http\Livewire\ServerSshKeys\AddNewKey;
use App\Http\Livewire\ServerSshKeys\ServerKeysList;
use App\Jobs\SshKey\DeleteSshKeyFromServer;
use App\Jobs\SshKey\DeploySshKeyToServer;
use App\Models\SshKey;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Bus;
use Livewire\Livewire;
use Tests\TestCase;
class ServerKeysTest extends TestCase
@ -32,7 +28,7 @@ public function test_see_server_keys()
'status' => SshKeyStatus::ADDED,
]);
Livewire::test(ServerKeysList::class, ['server' => $this->server])
$this->get(route('servers.ssh-keys', $this->server))
->assertSeeText('My first key');
}
@ -52,10 +48,7 @@ public function test_delete_ssh_key()
'status' => SshKeyStatus::ADDED,
]);
Livewire::test(ServerKeysList::class, ['server' => $this->server])
->set('deleteId', $sshKey->id)
->call('delete')
->assertDispatched('confirmed');
$this->delete(route('servers.ssh-keys.destroy', [$this->server, $sshKey]));
$this->assertDatabaseHas('server_ssh_keys', [
'server_id' => $this->server->id,
@ -72,12 +65,10 @@ public function test_add_new_ssh_key()
$this->actingAs($this->user);
Livewire::test(AddNewKey::class, ['server' => $this->server])
->set('name', 'My first key')
->set('public_key', 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3CCnyBbpCgOJ0AWUSfBZ+mYAsYzcQDegPkBx1kyE0bXT1yX4+6uYx1Jh6NxWgLyaU0BaP4nsClrK1u5FojQHd8J7ycc0N3H8B+v2NPzj1Q6bFnl40saastONVm+d4edbCg9BowGAafLcf9ALsognqqOWQbK/QOpAhg25IAe47eiY3IjDGMHlsvaZkMtkDhT4t1mK8ZLjxw5vjyVYgINJefR981bIxMFrXy+0xBCsYOZxMIoAJsgCkrAGlI4kQHKv0SQVccSyTE1eziIZa5b3QUlXj8ogxMfK/EOD7Aoqinw652k4S5CwFs/LLmjWcFqCKDM6CSggWpB78DZ729O6zFvQS9V99/9SsSV7Qc5ML7B0DKzJ/tbHkaAE8xdZnQnZFVUegUMtUmjvngMaGlYsxkAZrUKsFRoh7xfXVkDyRBaBSslRNe8LFsXw9f7Q+3jdZ5vhGhmp+TBXTlgxApwR023411+ABE9y0doCx8illya3m2olEiiMZkRclgqsWFSk=')
->call('add')
->assertSuccessful()
->assertDispatched('added');
$this->post(route('servers.ssh-keys.store', $this->server), [
'name' => 'My first key',
'public_key' => 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQC3CCnyBbpCgOJ0AWUSfBZ+mYAsYzcQDegPkBx1kyE0bXT1yX4+6uYx1Jh6NxWgLyaU0BaP4nsClrK1u5FojQHd8J7ycc0N3H8B+v2NPzj1Q6bFnl40saastONVm+d4edbCg9BowGAafLcf9ALsognqqOWQbK/QOpAhg25IAe47eiY3IjDGMHlsvaZkMtkDhT4t1mK8ZLjxw5vjyVYgINJefR981bIxMFrXy+0xBCsYOZxMIoAJsgCkrAGlI4kQHKv0SQVccSyTE1eziIZa5b3QUlXj8ogxMfK/EOD7Aoqinw652k4S5CwFs/LLmjWcFqCKDM6CSggWpB78DZ729O6zFvQS9V99/9SsSV7Qc5ML7B0DKzJ/tbHkaAE8xdZnQnZFVUegUMtUmjvngMaGlYsxkAZrUKsFRoh7xfXVkDyRBaBSslRNe8LFsXw9f7Q+3jdZ5vhGhmp+TBXTlgxApwR023411+ABE9y0doCx8illya3m2olEiiMZkRclgqsWFSk=',
]);
$this->assertDatabaseHas('server_ssh_keys', [
'server_id' => $this->server->id,
@ -99,11 +90,9 @@ public function test_add_existing_key()
'public_key' => 'public-key-content',
]);
Livewire::test(AddExistingKey::class, ['server' => $this->server])
->set('key_id', $sshKey->id)
->call('add')
->assertSuccessful()
->assertDispatched('added');
$this->post(route('servers.ssh-keys.deploy', $this->server), [
'key_id' => $sshKey->id,
]);
$this->assertDatabaseHas('server_ssh_keys', [
'server_id' => $this->server->id,