add all controllers logic
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Resources\Ui;
|
||||
|
||||
use App\Http\Resources\Ui\UiStyleResource;
|
||||
use App\Models\Preferences;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UiStyleResourceTest extends TestCase
|
||||
{
|
||||
public function test_resource_returns_expected_shape(): void
|
||||
{
|
||||
$prefs = new Preferences([
|
||||
'style_color' => 'blue',
|
||||
'menu_color' => 'custom',
|
||||
'menu_custom_bg' => '#112233',
|
||||
'menu_custom_text' => '#FFFFFF',
|
||||
'menu_custom_mode' => 'dark',
|
||||
]);
|
||||
|
||||
$payload = (new UiStyleResource($prefs))->toArray(request());
|
||||
|
||||
$this->assertSame('blue', $payload['style_color']);
|
||||
$this->assertSame('custom', $payload['menu_color']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user