Check connection'
);
expect($html)
->toContain('wire:loading.attr="disabled"')
->toContain('wire:loading.class="is-loading"')
->toContain('wire:target="checkConnection"')
->toContain('wire:loading')
->toContain('animate-spin')
->toContain('Check connection');
});
it('uses an explicit wire target for submit buttons without wire click', function () {
$html = Blade::render(
'Validate and add'
);
expect($html)
->toContain('type="submit"')
->toContain('wire:loading.attr="disabled"')
->toContain('wire:loading.class="is-loading"')
->toContain('wire:target="addToken"')
->toContain('animate-spin')
->toContain('Validate and add');
});
it('targets the S3 connection validation submit action', function () {
$view = file_get_contents(resource_path('views/livewire/storage/create.blade.php'));
expect($view)->toContain('');
});
it('keeps method arguments when deriving the loading target', function () {
$html = Blade::render(
'Use this key'
);
expect($html)
->toContain('wire:target="setPrivateKey(42)"')
->toContain('wire:loading.attr="disabled"')
->toContain('wire:loading.class="is-loading"');
});
it('skips loading attributes when the loading indicator is disabled', function () {
$html = Blade::render(
'Check connection'
);
expect($html)
->not->toContain('wire:loading.attr="disabled"')
->not->toContain('wire:loading.class="is-loading"')
->not->toContain('animate-spin')
->toContain('Check connection');
});
it('hides static button icons with the shared is-loading utility', function () {
$css = file_get_contents(resource_path('css/utilities.css'));
expect($css)->toContain('.button.is-loading > svg:not(.animate-spin)');
});
it('applies automatic loading behavior on the server private key check connection button', function () {
$view = file_get_contents(resource_path('views/livewire/server/private-key/show.blade.php'));
expect($view)
->toContain('wire:click.prevent="checkConnection"')
->toContain('')
->toContain('