From f413d94ac984f31a7fd38ca2a19822cb4dbee0c7 Mon Sep 17 00:00:00 2001 From: pemudakoding Date: Fri, 10 Mar 2023 21:04:43 +0800 Subject: [PATCH] fix: alert box classes isn't match with filament classes --- .../views/components/base-alert-box.blade.php | 16 ++++++++-------- .../Forms/AlertBoxBackgroundColorTest.php | 8 ++++---- tests/Livewire/Forms/AlertBoxIconTest.php | 4 ++-- tests/Livewire/Widget/WidgetOkTest.php | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/resources/views/components/base-alert-box.blade.php b/resources/views/components/base-alert-box.blade.php index 285755e..9f81e09 100644 --- a/resources/views/components/base-alert-box.blade.php +++ b/resources/views/components/base-alert-box.blade.php @@ -3,18 +3,18 @@ @php $backgroundClass = match($type) { - 'primary' => 'bg-primary-300', - 'success' => 'bg-success-300', - 'warning' => 'bg-warning-300', - 'danger' => 'bg-danger-400', - 'secondary' => 'bg-slate-300', + 'primary' => 'bg-primary-500', + 'success' => 'bg-success-500', + 'warning' => 'bg-warning-500', + 'danger' => 'bg-danger-500', + 'secondary' => 'bg-gray-500', }; $textColor = match($type) { 'primary', 'success', - 'warning' => 'text-slate-700', - default => 'text-slate-50' + 'warning' => 'text-gray-900', + default => 'text-gray-50' }; @endphp @@ -30,7 +30,7 @@ }} > @if ($icon = $icon) -
+
@endif diff --git a/tests/Livewire/Forms/AlertBoxBackgroundColorTest.php b/tests/Livewire/Forms/AlertBoxBackgroundColorTest.php index c635a57..2ffceef 100644 --- a/tests/Livewire/Forms/AlertBoxBackgroundColorTest.php +++ b/tests/Livewire/Forms/AlertBoxBackgroundColorTest.php @@ -15,7 +15,7 @@ ]; livewire(name: CreatePost::class) - ->assertSee(values: baseClassWith(backgroundColor: 'bg-success-300', textColor: 'text-slate-700')); + ->assertSee(values: baseClassWith(backgroundColor: 'bg-success-500', textColor: 'text-gray-900')); }); it(description: 'can show success background color when type is warning') @@ -27,7 +27,7 @@ ]; livewire(name: CreatePost::class) - ->assertSee(values: baseClassWith(backgroundColor: 'bg-warning-300', textColor: 'text-slate-700')); + ->assertSee(values: baseClassWith(backgroundColor: 'bg-warning-500', textColor: 'text-gray-900')); }); it(description: 'can show success background color when type is primary') @@ -39,7 +39,7 @@ ]; livewire(name: CreatePost::class) - ->assertSee(values: baseClassWith(backgroundColor: 'bg-primary-300', textColor: 'text-slate-700')); + ->assertSee(values: baseClassWith(backgroundColor: 'bg-primary-500', textColor: 'text-gray-900')); }); it(description: 'can show success background color when type is danger') @@ -51,5 +51,5 @@ ]; livewire(name: CreatePost::class) - ->assertSee(values: baseClassWith(backgroundColor: 'bg-danger-400', textColor: 'text-slate-50')); + ->assertSee(values: baseClassWith(backgroundColor: 'bg-danger-500', textColor: 'text-gray-50')); }); diff --git a/tests/Livewire/Forms/AlertBoxIconTest.php b/tests/Livewire/Forms/AlertBoxIconTest.php index 806d473..3eef2f0 100644 --- a/tests/Livewire/Forms/AlertBoxIconTest.php +++ b/tests/Livewire/Forms/AlertBoxIconTest.php @@ -12,7 +12,7 @@ ]; livewire(name: CreatePost::class) - ->assertSee(values: 'icon mr-5'); + ->assertSee(values: 'icon px-3 mr-2'); }); it(description: 'can show the icon if resolve the icon manually') @@ -24,5 +24,5 @@ ]; livewire(name: CreatePost::class) - ->assertSee(values: 'icon mr-5'); + ->assertSee(values: 'icon px-3 mr-2'); }); diff --git a/tests/Livewire/Widget/WidgetOkTest.php b/tests/Livewire/Widget/WidgetOkTest.php index 239883a..6b05d71 100644 --- a/tests/Livewire/Widget/WidgetOkTest.php +++ b/tests/Livewire/Widget/WidgetOkTest.php @@ -7,7 +7,7 @@ it(description: 'can render element') ->tap(callable: function () { livewire(name: WidgetTestComponent::class)->assertOk() - ->assertSee(values: ['Test', 'please shut u freakin mouth', 'icon mr-5']) - ->assertSee(values: baseClassWith(backgroundColor: 'bg-success-300', textColor: 'text-slate-700')); + ->assertSee(values: ['Test', 'please shut u freakin mouth', 'icon px-3 mr-2']) + ->assertSee(values: baseClassWith(backgroundColor: 'bg-success-500', textColor: 'text-gray-900')); }) ->group('widget');