mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 10:18:20 +00:00
fix(ui): polish create flows for compose and GitHub repos
Use shared listbox for private-repo selection, align listbox trigger heights with form inputs, restore compose editor spacing and full width, and wire loading states on create/continue actions.
This commit is contained in:
1 parent
9c0908f0fc
commit
c07f66cb5e
6 files changed
+73
-13
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
it('keeps spacing around the Docker Compose editor', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/project/new/docker-compose.blade.php'));
|
||||
|
||||
expect($view)
|
||||
->toContain('class="application-settings-section-body"')
|
||||
->not->toContain('class="application-settings-section-body p-0!"');
|
||||
});
|
||||
|
||||
it('lets the Docker Compose editor use the available width', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/project/new/docker-compose.blade.php'));
|
||||
|
||||
expect($view)
|
||||
->toContain('class="mt-8 w-full lg:mt-3"')
|
||||
->not->toContain('max-w-[1180px]');
|
||||
});
|
||||
|
||||
it('shows a loading indicator while creating the service', function () {
|
||||
$view = file_get_contents(resource_path('views/livewire/project/new/docker-compose.blade.php'));
|
||||
|
||||
expect($view)->toContain('<x-forms.button type="submit" wire:target="submit" isHighlighted>');
|
||||
});
|
||||
@@ -105,6 +105,32 @@ describe('GitHub Private Repository Component', function () {
|
||||
->assertSet('selected_repository_id', 1);
|
||||
});
|
||||
|
||||
test('repository selection uses the shared listbox and disables loading action', function () {
|
||||
fakeGithubHttp([
|
||||
['id' => 1, 'name' => 'alpha-repo', 'owner' => ['login' => 'testuser']],
|
||||
]);
|
||||
|
||||
Livewire::test(GithubPrivateRepository::class, ['type' => 'private-gh-app'])
|
||||
->call('loadRepositories', $this->githubApp->id)
|
||||
->assertSee('id="selected_repository_id-trigger"', false)
|
||||
->assertSee('wire:loading.attr="disabled"', false)
|
||||
->assertSee('wire:target="loadBranches,selected_repository_id"', false)
|
||||
->assertDontSee('<datalist', false);
|
||||
});
|
||||
|
||||
test('continue button uses the shared submit loading indicator', function () {
|
||||
fakeGithubHttp([
|
||||
['id' => 1, 'name' => 'alpha-repo', 'owner' => ['login' => 'testuser']],
|
||||
]);
|
||||
|
||||
Livewire::test(GithubPrivateRepository::class, ['type' => 'private-gh-app'])
|
||||
->call('loadRepositories', $this->githubApp->id)
|
||||
->set('branches', collect([['name' => 'main']]))
|
||||
->assertSee('type="submit"', false)
|
||||
->assertSee('wire:target="submit"', false)
|
||||
->assertSee('wire:loading.class="is-loading"', false);
|
||||
});
|
||||
|
||||
test('loadRepositories rejects a github app owned by another team', function () {
|
||||
$victimTeam = Team::factory()->create();
|
||||
$victimPrivateKey = githubPrivateRepositoryTestPrivateKeyForTeam($victimTeam);
|
||||
|
||||
@@ -14,6 +14,14 @@ test('listbox trigger styles constrain width and ellipsize long labels', functio
|
||||
->toContain('white-space: nowrap;');
|
||||
});
|
||||
|
||||
test('listbox trigger height matches shared inputs', function () {
|
||||
$css = file_get_contents(resource_path('css/app.css'));
|
||||
|
||||
expect($css)
|
||||
->toMatch('/\.listbox-trigger \{[^}]*height: 2\.25rem;/s')
|
||||
->toMatch('/\.application-settings-workspace \.listbox-trigger[^}]*height: 2rem;/s');
|
||||
});
|
||||
|
||||
test('listbox component uses shared trigger label truncation', function () {
|
||||
$html = Blade::render(<<<'BLADE'
|
||||
<x-forms.listbox id="longOption" label="Example"
|
||||
|
||||
Reference in new issue
Block a user