Files
coolify/tests/Feature/ServerCreationBuildRoleLayoutTest.php
T
Andras Bacsai 383a5a742f feat(servers): add configurable deployment and build roles
Introduce deployment, build, and dual-purpose server roles, with API and UI support, build-server fallback controls, and role-aware resource hosting.
2026-09-19 17:22:13 +02:00

25 lines
1.2 KiB
PHP

<?php
test('server creation keeps private key actions together and advanced options collapsed', function () {
$view = file_get_contents(resource_path('views/livewire/server/new/by-ip.blade.php'));
expect($view)
->toContain('class="flex items-end gap-3"')
->toContain('<x-forms.collapsible class="mt-5 border-t border-neutral-200 pt-4 dark:border-white/[0.08]"')
->toContain('<x-forms.listbox id="server_role"')
->toContain('label="Server role"')
->toContain("['value' => 'deployment', 'label' => 'Deployments only']")
->toContain("['value' => 'build', 'label' => 'Builds only']")
->toContain("['value' => 'both', 'label' => 'Deployments and builds']")
->not->toContain('<x-forms.checkbox id="is_build_server"');
});
test('server creation places the IP address and private key before optional details', function () {
$view = file_get_contents(resource_path('views/livewire/server/new/by-ip.blade.php'));
expect($view)
->toContain('class="mb-5"')
->and(strpos($view, 'id="ip"'))->toBeLessThan(strpos($view, 'id="private_key_id"'))
->and(strpos($view, 'id="private_key_id"'))->toBeLessThan(strpos($view, 'id="name"'));
});