feat(server): add dedicated server creation flow

This commit is contained in:
Andras Bacsai committed 2026-07-08 12:20:56 +02:00
1 parent 18f0f7f6be
commit 7236cb8228
31 files changed
+1158 -352

No files matched your search

+15 -2
View File
@@ -6,11 +6,24 @@ it('allows selecting Vultr in cloud provider token forms', function () {
expect($view)->toContain('<x-forms.select required id="provider" label="Provider" wire:model.live="provider">')
->and($view)->toContain('<option value="vultr">Vultr</option>')
->and($view)->toContain('<option disabled value="digitalocean">DigitalOcean</option>')
->and($view)->toContain('<option value="digitalocean">DigitalOcean</option>')
->and(substr_count($view, 'Open Account → API Access.'))->toBe(2)
->and(substr_count($view, 'https://console.vultr.com/user/apiaccess/'))->toBe(2)
->and($view)->not->toContain('<option value="digitalocean">DigitalOcean</option>')
->and($view)->not->toContain('cloudProviderTokens->where(\'provider\', $provider)->isEmpty()')
->and($view)->not->toContain('<x-forms.select required id="provider" label="Provider" disabled>')
->and($component)->toContain("'provider' => 'required|string|in:hetzner,digitalocean,vultr'");
});
it('keeps provider affiliate links on server provider views', function () {
$tokenFormView = file_get_contents(__DIR__.'/../../resources/views/livewire/security/cloud-provider-token-form.blade.php');
$hetznerView = file_get_contents(__DIR__.'/../../resources/views/livewire/server/new/by-hetzner.blade.php');
$vultrView = file_get_contents(__DIR__.'/../../resources/views/livewire/server/new/by-vultr.blade.php');
$digitalOceanView = file_get_contents(__DIR__.'/../../resources/views/livewire/server/new/by-digital-ocean.blade.php');
expect($tokenFormView)
->not->toContain('https://coolify.io/hetzner')
->not->toContain('https://coolify.io/vultr')
->and($hetznerView)->toContain('https://coolify.io/hetzner')
->and($vultrView)->toContain('https://coolify.io/vultr')
->and($digitalOceanView)->toContain('https://coolify.io/digitalocean');
});
@@ -33,6 +33,19 @@ it('ensures GlobalSearch uses redirect route helper', function () {
->toContain('redirectRoute($this, \'project.resource.create\'');
});
it('routes new server quick action to the new server page', function () {
$globalSearchFile = file_get_contents(__DIR__.'/../../app/Livewire/GlobalSearch.php');
$bladeFile = file_get_contents(__DIR__.'/../../resources/views/livewire/global-search.blade.php');
expect($globalSearchFile)
->toContain("if (\$type === 'server')")
->toContain("redirectRoute(\$this, 'server.create')");
expect($bladeFile)
->toContain("window.location.href = '/servers/new'")
->not->toContain('@open-create-modal-server.window');
});
it('ensures docker-image item has quickcommand with new image', function () {
$globalSearchFile = file_get_contents(__DIR__.'/../../app/Livewire/GlobalSearch.php');
@@ -142,3 +155,13 @@ it('uses cropped image assets instead of inline wide logos for GlobalSearch data
expect($globalSearchFile)->not->toContain("'logo_html' =>");
});
it('uses rounded yellow plus icons for GlobalSearch creatable actions without logos', function () {
$bladeFile = file_get_contents(__DIR__.'/../../resources/views/livewire/global-search.blade.php');
expect($bladeFile)
->toContain('rounded-full bg-warning/20 flex items-center justify-center')
->toContain('class="h-6 w-6 text-warning"')
->not->toContain('rounded-lg bg-warning-100 dark:bg-warning-900/40')
->not->toContain('text-warning-600 dark:text-warning-400');
});