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,12 +2,10 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Http\Livewire\SourceControls\Connect;
|
||||
use App\Http\Livewire\SourceControls\SourceControlsList;
|
||||
use App\Models\SourceControl;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
use Livewire\Livewire;
|
||||
use JsonException;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SourceControlsTest extends TestCase
|
||||
@ -16,6 +14,8 @@ class SourceControlsTest extends TestCase
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function test_connect_provider(string $provider, ?string $customUrl): void
|
||||
{
|
||||
@ -23,18 +23,17 @@ public function test_connect_provider(string $provider, ?string $customUrl): voi
|
||||
|
||||
Http::fake();
|
||||
|
||||
$livewire = Livewire::test(Connect::class)
|
||||
->set('token', 'token')
|
||||
->set('name', 'profile')
|
||||
->set('provider', $provider);
|
||||
$input = [
|
||||
'name' => 'test',
|
||||
'provider' => $provider,
|
||||
'token' => 'token',
|
||||
];
|
||||
|
||||
if ($customUrl !== null) {
|
||||
$livewire->set('url', $customUrl);
|
||||
$input['url'] = $customUrl;
|
||||
}
|
||||
|
||||
$livewire
|
||||
->call('connect')
|
||||
->assertSuccessful();
|
||||
$this->post(route('source-controls.connect'), $input)
|
||||
->assertSessionHasNoErrors();
|
||||
|
||||
$this->assertDatabaseHas('source_controls', [
|
||||
'provider' => $provider,
|
||||
@ -44,6 +43,8 @@ public function test_connect_provider(string $provider, ?string $customUrl): voi
|
||||
|
||||
/**
|
||||
* @dataProvider data
|
||||
*
|
||||
* @throws JsonException
|
||||
*/
|
||||
public function test_delete_provider(string $provider): void
|
||||
{
|
||||
@ -55,10 +56,8 @@ public function test_delete_provider(string $provider): void
|
||||
'profile' => 'test',
|
||||
]);
|
||||
|
||||
Livewire::test(SourceControlsList::class)
|
||||
->set('deleteId', $sourceControl->id)
|
||||
->call('delete')
|
||||
->assertSuccessful();
|
||||
$this->delete(route('source-controls.delete', $sourceControl->id))
|
||||
->assertSessionHasNoErrors();
|
||||
|
||||
$this->assertDatabaseMissing('source_controls', [
|
||||
'id' => $sourceControl->id,
|
||||
|
Reference in New Issue
Block a user