mirror of
https://github.com/usetrmnl/byos_laravel.git
synced 2026-01-16 16:37:47 +00:00
refactor: upgrade to Livewire 4
This commit is contained in:
parent
c94dd89361
commit
a15645ad88
56 changed files with 166 additions and 278 deletions
|
|
@ -3,7 +3,6 @@
|
|||
use App\Models\Plugin;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Livewire\Volt\Volt;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
uses(RefreshDatabase::class);
|
||||
|
|
@ -28,7 +27,7 @@ test('config modal correctly loads multi_string defaults into UI boxes', functio
|
|||
'configuration' => ['tags' => 'alpha,beta']
|
||||
]);
|
||||
|
||||
Volt::test('plugins.config-modal', ['plugin' => $plugin])
|
||||
Livewire::test('plugins.config-modal', ['plugin' => $plugin])
|
||||
->assertSet('multiValues.tags', ['alpha', 'beta']);
|
||||
});
|
||||
|
||||
|
|
@ -50,7 +49,7 @@ test('config modal validates against commas in multi_string boxes', function ():
|
|||
]
|
||||
]);
|
||||
|
||||
Volt::test('plugins.config-modal', ['plugin' => $plugin])
|
||||
Livewire::test('plugins.config-modal', ['plugin' => $plugin])
|
||||
->set('multiValues.tags.0', 'no,commas,allowed')
|
||||
->call('saveConfiguration')
|
||||
->assertHasErrors(['multiValues.tags.0' => 'regex']);
|
||||
|
|
@ -78,7 +77,7 @@ test('config modal merges multi_string boxes into a single CSV string on save',
|
|||
'configuration' => []
|
||||
]);
|
||||
|
||||
Volt::test('plugins.config-modal', ['plugin' => $plugin])
|
||||
Livewire::test('plugins.config-modal', ['plugin' => $plugin])
|
||||
->set('multiValues.items.0', 'First')
|
||||
->call('addMultiItem', 'items')
|
||||
->set('multiValues.items.1', 'Second')
|
||||
|
|
@ -100,7 +99,7 @@ test('config modal resetForm clears dirty state and increments resetIndex', func
|
|||
'configuration' => ['simple_key' => 'original_value']
|
||||
]);
|
||||
|
||||
Volt::test('plugins.config-modal', ['plugin' => $plugin])
|
||||
Livewire::test('plugins.config-modal', ['plugin' => $plugin])
|
||||
->set('configuration.simple_key', 'dirty_value')
|
||||
->call('resetForm')
|
||||
->assertSet('configuration.simple_key', 'original_value')
|
||||
|
|
@ -118,7 +117,7 @@ test('config modal dispatches update event for parent warning refresh', function
|
|||
'data_strategy' => 'static'
|
||||
]);
|
||||
|
||||
Volt::test('plugins.config-modal', ['plugin' => $plugin])
|
||||
Livewire::test('plugins.config-modal', ['plugin' => $plugin])
|
||||
->call('saveConfiguration')
|
||||
->assertDispatched('config-updated');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue