mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-07 18:17:06 +00:00
feat(ui): Shadow UI redesign, domain management, and DNS autoconfigure (#11119)
Co-authored-by: ShadowArcanist <162910371+ShadowArcanist@users.noreply.github.com>
This commit is contained in:
co-authored by
ShadowArcanist
parent
0b843bb07c
commit
8ae56587d5
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
|
||||
test('searchable listbox renders search field and filters options client-side', function () {
|
||||
$html = Blade::render(<<<'BLADE'
|
||||
<x-forms.searchable-listbox id="serverTimezone" label="Server timezone"
|
||||
searchPlaceholder="Search timezones" emptyText="No matching timezone"
|
||||
:options="[
|
||||
['value' => 'UTC', 'label' => 'UTC'],
|
||||
['value' => 'Europe/Berlin', 'label' => 'Europe/Berlin'],
|
||||
['value' => 'America/New_York', 'label' => 'America/New_York'],
|
||||
]" :wire="false" value="UTC" />
|
||||
BLADE);
|
||||
|
||||
expect($html)
|
||||
->toContain('Server timezone')
|
||||
->toContain('Search timezones')
|
||||
->toContain('No matching timezone')
|
||||
->toContain('serverTimezone-trigger')
|
||||
->toContain('x-ref="search"')
|
||||
->toContain('get filtered()')
|
||||
->toContain('searchable-listbox-panel')
|
||||
->toContain('Berlin')
|
||||
->toContain('New_York');
|
||||
});
|
||||
|
||||
test('server timezone fields use the searchable listbox component', function () {
|
||||
$localhost = file_get_contents(resource_path('views/livewire/server/partials/localhost-general.blade.php'));
|
||||
$show = file_get_contents(resource_path('views/livewire/server/show.blade.php'));
|
||||
|
||||
expect($localhost)
|
||||
->toContain('x-forms.searchable-listbox id="serverTimezone"')
|
||||
->toContain('searchPlaceholder="Search timezones"')
|
||||
->not->toContain('<x-forms.listbox id="serverTimezone"');
|
||||
|
||||
expect($show)
|
||||
->toContain('x-forms.searchable-listbox id="serverTimezone"')
|
||||
->toContain('searchPlaceholder="Search timezones"')
|
||||
->not->toMatch('/<x-forms\.listbox id="serverTimezone"/');
|
||||
});
|
||||
|
||||
test('searchable listbox keeps the helper outside the label association', function () {
|
||||
$html = Blade::render(<<<'BLADE'
|
||||
<x-forms.searchable-listbox id="tz" label="Timezone"
|
||||
helper="Used for cron jobs." searchPlaceholder="Search"
|
||||
:options="[['value' => 'UTC', 'label' => 'UTC']]" :wire="false" value="UTC" />
|
||||
BLADE);
|
||||
|
||||
expect($html)
|
||||
->toContain('Used for cron jobs.')
|
||||
->toContain('aria-label="More information"')
|
||||
->not->toMatch('/<label[^>]*for="tz-trigger"[^>]*>[\s\S]*aria-label="More information"[\s\S]*<\/label>/');
|
||||
});
|
||||
Reference in New Issue
Block a user