I have the following field:
ColorPicker::make('primary_color')
->live()
->afterStateUpdated(function ($state) {
$this->dispatch('applyThemeColors', [
'primary_color' => $state,
]);
})
->hex()
->hexColor()
->nullable()
->helperText('Leave blank to use default colors'),
and the following test:
$component = livewire(BrandingSettings::class, ['location' => null])
->assertSuccessful()
->fillForm(['primary_color' => '#007bff'])
->assertDispatched('applyThemeColors');
On the live site it all works, I assumed this test would have picked it up, however it doesn't.
I'm just wondering is there something I need to do in my test to ensure the afterStateUpdated() is fired? The field is set to live().