mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
Setup Inertia (#593)
This commit is contained in:
@ -3,10 +3,8 @@
|
||||
namespace Tests\Feature\API;
|
||||
|
||||
use App\Models\Project;
|
||||
use App\Web\Pages\Settings\Projects\Settings;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use Livewire\Livewire;
|
||||
use Tests\TestCase;
|
||||
|
||||
class ProjectsTest extends TestCase
|
||||
@ -50,10 +48,7 @@ public function test_delete_project(): void
|
||||
|
||||
$this->user->projects()->attach($project);
|
||||
|
||||
Livewire::test(Settings::class, [
|
||||
'project' => $project,
|
||||
])
|
||||
->callAction('delete')
|
||||
$this->json('DELETE', '/api/projects/'.$project->id)
|
||||
->assertSuccessful();
|
||||
|
||||
$this->assertDatabaseMissing('projects', [
|
||||
|
@ -3,11 +3,9 @@
|
||||
namespace Tests\Feature\API;
|
||||
|
||||
use App\Models\SourceControl;
|
||||
use App\Web\Pages\Settings\SourceControls\Widgets\SourceControlsList;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use Livewire\Livewire;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SourceControlsTest extends TestCase
|
||||
@ -76,9 +74,14 @@ public function test_cannot_delete_provider(string $provider): void
|
||||
'source_control_id' => $sourceControl->id,
|
||||
]);
|
||||
|
||||
Livewire::test(SourceControlsList::class)
|
||||
->callTableAction('delete', $sourceControl->id)
|
||||
->assertNotified('This source control is being used by a site.');
|
||||
$this->json('DELETE', route('api.projects.source-controls.delete', [
|
||||
'project' => $this->user->current_project_id,
|
||||
'sourceControl' => $sourceControl->id,
|
||||
]))
|
||||
->assertStatus(422)
|
||||
->assertJsonFragment([
|
||||
'message' => 'This source control is being used by a site.',
|
||||
]);
|
||||
|
||||
$this->assertNotSoftDeleted('source_controls', [
|
||||
'id' => $sourceControl->id,
|
||||
|
Reference in New Issue
Block a user