mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-01 05:56:16 +00:00
Migrate to HTMX (#114)
Dropped Livewire Added HTMX Added Blade code lint Drop Mysql and Redis Migrate to SQLite
This commit is contained in:
@ -2,17 +2,11 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Http\Livewire\Application\AutoDeployment;
|
||||
use App\Http\Livewire\Application\ChangeBranch;
|
||||
use App\Http\Livewire\Application\Deploy;
|
||||
use App\Http\Livewire\Application\DeploymentScript;
|
||||
use App\Http\Livewire\Application\LaravelApp;
|
||||
use App\Jobs\Site\UpdateBranch;
|
||||
use App\Models\GitHook;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Bus;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Livewire\Livewire;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ApplicationTest extends TestCase
|
||||
@ -30,30 +24,27 @@ public function test_visit_application()
|
||||
])
|
||||
)
|
||||
->assertOk()
|
||||
->assertSeeLivewire(LaravelApp::class);
|
||||
->assertSee($this->site->domain);
|
||||
}
|
||||
|
||||
public function test_update_deployment_script()
|
||||
{
|
||||
$this->actingAs($this->user);
|
||||
|
||||
Livewire::test(Deploy::class, ['site' => $this->site])
|
||||
->assertDontSeeText('Deploy');
|
||||
|
||||
Livewire::test(DeploymentScript::class, ['site' => $this->site])
|
||||
->set('script', 'some script')
|
||||
->call('save')
|
||||
->assertSuccessful();
|
||||
$this->post(
|
||||
route('servers.sites.application.deployment-script', [
|
||||
'server' => $this->server,
|
||||
'site' => $this->site,
|
||||
]),
|
||||
[
|
||||
'script' => 'some script',
|
||||
]
|
||||
)->assertSessionDoesntHaveErrors();
|
||||
|
||||
$this->assertDatabaseHas('deployment_scripts', [
|
||||
'site_id' => $this->site->id,
|
||||
'content' => 'some script',
|
||||
]);
|
||||
|
||||
$this->site->refresh();
|
||||
|
||||
Livewire::test(Deploy::class, ['site' => $this->site])
|
||||
->assertSeeText('Deploy');
|
||||
}
|
||||
|
||||
public function test_change_branch()
|
||||
@ -62,10 +53,12 @@ public function test_change_branch()
|
||||
|
||||
$this->actingAs($this->user);
|
||||
|
||||
Livewire::test(ChangeBranch::class, ['site' => $this->site])
|
||||
->set('branch', 'master')
|
||||
->call('change')
|
||||
->assertSuccessful();
|
||||
$this->post(route('servers.sites.application.branch', [
|
||||
'server' => $this->server,
|
||||
'site' => $this->site,
|
||||
]), [
|
||||
'branch' => 'master',
|
||||
])->assertSessionDoesntHaveErrors();
|
||||
|
||||
Bus::assertDispatched(UpdateBranch::class);
|
||||
}
|
||||
@ -80,9 +73,10 @@ public function test_enable_auto_deployment()
|
||||
|
||||
$this->actingAs($this->user);
|
||||
|
||||
Livewire::test(AutoDeployment::class, ['site' => $this->site])
|
||||
->call('enable')
|
||||
->assertSuccessful();
|
||||
$this->post(route('servers.sites.application.auto-deployment', [
|
||||
'server' => $this->server,
|
||||
'site' => $this->site,
|
||||
]))->assertSessionDoesntHaveErrors();
|
||||
|
||||
$this->site->refresh();
|
||||
|
||||
@ -102,9 +96,10 @@ public function test_disable_auto_deployment()
|
||||
'source_control_id' => $this->site->source_control_id,
|
||||
]);
|
||||
|
||||
Livewire::test(AutoDeployment::class, ['site' => $this->site])
|
||||
->call('disable')
|
||||
->assertSuccessful();
|
||||
$this->delete(route('servers.sites.application.auto-deployment', [
|
||||
'server' => $this->server,
|
||||
'site' => $this->site,
|
||||
]))->assertSessionDoesntHaveErrors();
|
||||
|
||||
$this->site->refresh();
|
||||
|
||||
|
Reference in New Issue
Block a user