mirror of
https://github.com/coollabsio/coolify.git
synced 2026-08-24 10:05:47 -05:00
Close the confirmation modal before submitting destructive actions and reopen it when submission fails or returns an error.
18 lines
792 B
PHP
18 lines
792 B
PHP
<?php
|
|
|
|
test('confirmation modal closes before dispatching an event that can open another modal', function () {
|
|
$modal = file_get_contents(resource_path('views/components/modal-confirmation.blade.php'));
|
|
|
|
expect($modal)->toMatch(
|
|
'/if \(dispatchEvent\) \{\s*modalOpen = false;\s*\$nextTick\(\(\) => \$wire\.dispatch\(dispatchEventType, dispatchEventMessage\)\);/s'
|
|
);
|
|
});
|
|
|
|
test('confirmation modal releases its scroll lock before submitting a destructive action', function () {
|
|
$modal = file_get_contents(resource_path('views/components/modal-confirmation.blade.php'));
|
|
|
|
expect($modal)
|
|
->toMatch('/submitting = true;\s*modalOpen = false;\s*\$nextTick\(\(\) => \{\s*submitForm\(\)/s')
|
|
->toMatch('/if \(result === true\) \{\s*resetModal\(\);/s');
|
|
});
|