File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
tests/Feature/Filament/Widgets Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 7
7
use Cachet \Models \ComponentGroup ;
8
8
use Filament \Forms \Components \Component as FilamentFormComponent ;
9
9
use Filament \Forms \Components \Group ;
10
- use Filament \Forms \Components \ToggleButtons ;
11
10
use Filament \Forms \Components \Section ;
11
+ use Filament \Forms \Components \ToggleButtons ;
12
12
use Filament \Forms \Concerns \InteractsWithForms ;
13
13
use Filament \Forms \Contracts \HasForms ;
14
14
use Filament \Forms \Form ;
@@ -56,7 +56,7 @@ public function form(Form $form): Form
56
56
});
57
57
58
58
$ ungroupedComponentSchema = $ this ->components
59
- ->filter (fn (Component $ component ) => is_null ($ component ->component_group_id ))
59
+ ->filter (fn (Component $ component ) => is_null ($ component ->component_group_id ))
60
60
->map (function (Component $ component ): FilamentFormComponent {
61
61
return Section::make ($ component ->name )
62
62
->schema (fn () => [$ this ->buildToggleButton ($ component )])
@@ -71,7 +71,7 @@ public function form(Form $form): Form
71
71
72
72
protected function buildToggleButton (Component $ component ): ToggleButtons
73
73
{
74
- return ToggleButtons::make ($ component ->id . '.status ' )
74
+ return ToggleButtons::make ($ component ->id . '.status ' )
75
75
->label ($ component ->name )
76
76
->hiddenLabel (is_null ($ component ->component_group_id ))
77
77
->inline ()
Original file line number Diff line number Diff line change 6
6
use Cachet \Filament \Widgets \Components ;
7
7
use Cachet \Models \Component ;
8
8
use Cachet \Models \ComponentGroup ;
9
+
9
10
use function Pest \Livewire \livewire ;
10
11
use function PHPUnit \Framework \assertCount ;
11
12
use function PHPUnit \Framework \assertEquals ;
118
119
$ livewireComponent ->assertSuccessful ();
119
120
120
121
$ livewireComponent ->set (
121
- 'formData. ' . $ component ->id . '.status ' ,
122
+ 'formData. ' . $ component ->id . '.status ' ,
122
123
ComponentStatusEnum::major_outage->value
123
124
);
124
125
137
138
$ livewireComponent ->assertSuccessful ();
138
139
139
140
$ livewireComponent ->set (
140
- 'formData. ' . $ component ->id . '.status ' ,
141
+ 'formData. ' . $ component ->id . '.status ' ,
141
142
ComponentStatusEnum::major_outage->value
142
143
);
143
144
144
145
assertEquals (ComponentStatusEnum::major_outage, $ component ->fresh ()->status );
145
- });
146
+ });
You can’t perform that action at this time.
0 commit comments