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
|
|
@ -1,28 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Providers;
|
|
||||||
|
|
||||||
use Illuminate\Support\ServiceProvider;
|
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
class VoltServiceProvider extends ServiceProvider
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Register services.
|
|
||||||
*/
|
|
||||||
public function register(): void
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bootstrap services.
|
|
||||||
*/
|
|
||||||
public function boot(): void
|
|
||||||
{
|
|
||||||
Volt::mount([
|
|
||||||
config('livewire.view_path', resource_path('views/livewire')),
|
|
||||||
resource_path('views/pages'),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -2,6 +2,4 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
App\Providers\AppServiceProvider::class,
|
App\Providers\AppServiceProvider::class,
|
||||||
App\Providers\FolioServiceProvider::class,
|
|
||||||
App\Providers\VoltServiceProvider::class,
|
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,8 @@
|
||||||
"laravel/sanctum": "^4.0",
|
"laravel/sanctum": "^4.0",
|
||||||
"laravel/socialite": "^5.23",
|
"laravel/socialite": "^5.23",
|
||||||
"laravel/tinker": "^2.10.1",
|
"laravel/tinker": "^2.10.1",
|
||||||
"livewire/livewire": "^3.7",
|
|
||||||
"livewire/flux": "^2.0",
|
"livewire/flux": "^2.0",
|
||||||
"livewire/volt": "^1.7",
|
"livewire/livewire": "^4.0",
|
||||||
"om/icalparser": "^3.2",
|
"om/icalparser": "^3.2",
|
||||||
"simplesoftwareio/simple-qrcode": "^4.2",
|
"simplesoftwareio/simple-qrcode": "^4.2",
|
||||||
"spatie/browsershot": "^5.0",
|
"spatie/browsershot": "^5.0",
|
||||||
|
|
|
||||||
85
composer.lock
generated
85
composer.lock
generated
|
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "ac6b1e352cb66f858a50b64e7e3c70d0",
|
"content-hash": "dea01d6eda8d497162134bf44c2a3adb",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "aws/aws-crt-php",
|
"name": "aws/aws-crt-php",
|
||||||
|
|
@ -3082,16 +3082,16 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "livewire/livewire",
|
"name": "livewire/livewire",
|
||||||
"version": "v3.7.4",
|
"version": "v4.0.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/livewire/livewire.git",
|
"url": "https://github.com/livewire/livewire.git",
|
||||||
"reference": "5a8dffd4c0ab357ff7ed5b39e7c2453d962a68e0"
|
"reference": "c7539589d5af82691bef17da17ce4e289269f8d9"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/livewire/livewire/zipball/5a8dffd4c0ab357ff7ed5b39e7c2453d962a68e0",
|
"url": "https://api.github.com/repos/livewire/livewire/zipball/c7539589d5af82691bef17da17ce4e289269f8d9",
|
||||||
"reference": "5a8dffd4c0ab357ff7ed5b39e7c2453d962a68e0",
|
"reference": "c7539589d5af82691bef17da17ce4e289269f8d9",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
|
|
@ -3146,7 +3146,7 @@
|
||||||
"description": "A front-end framework for Laravel.",
|
"description": "A front-end framework for Laravel.",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/livewire/livewire/issues",
|
"issues": "https://github.com/livewire/livewire/issues",
|
||||||
"source": "https://github.com/livewire/livewire/tree/v3.7.4"
|
"source": "https://github.com/livewire/livewire/tree/v4.0.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
|
@ -3154,78 +3154,7 @@
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2026-01-13T09:37:21+00:00"
|
"time": "2026-01-14T18:40:41+00:00"
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "livewire/volt",
|
|
||||||
"version": "v1.10.1",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/livewire/volt.git",
|
|
||||||
"reference": "48cff133990c6261c63ee279fc091af6f6c6654e"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/livewire/volt/zipball/48cff133990c6261c63ee279fc091af6f6c6654e",
|
|
||||||
"reference": "48cff133990c6261c63ee279fc091af6f6c6654e",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"laravel/framework": "^10.38.2|^11.0|^12.0",
|
|
||||||
"livewire/livewire": "^3.6.1|^4.0",
|
|
||||||
"php": "^8.1"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"laravel/folio": "^1.1",
|
|
||||||
"orchestra/testbench": "^8.36|^9.15|^10.8",
|
|
||||||
"pestphp/pest": "^2.9.5|^3.0|^4.0",
|
|
||||||
"phpstan/phpstan": "^1.10"
|
|
||||||
},
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"laravel": {
|
|
||||||
"providers": [
|
|
||||||
"Livewire\\Volt\\VoltServiceProvider"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"branch-alias": {
|
|
||||||
"dev-master": "1.x-dev"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"files": [
|
|
||||||
"functions.php"
|
|
||||||
],
|
|
||||||
"psr-4": {
|
|
||||||
"Livewire\\Volt\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"MIT"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Taylor Otwell",
|
|
||||||
"email": "taylor@laravel.com"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "Nuno Maduro",
|
|
||||||
"email": "nuno@laravel.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "An elegantly crafted functional API for Laravel Livewire.",
|
|
||||||
"homepage": "https://github.com/livewire/volt",
|
|
||||||
"keywords": [
|
|
||||||
"laravel",
|
|
||||||
"livewire",
|
|
||||||
"volt"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/livewire/volt/issues",
|
|
||||||
"source": "https://github.com/livewire/volt"
|
|
||||||
},
|
|
||||||
"time": "2025-11-25T16:19:15+00:00"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "maennchen/zipstream-php",
|
"name": "maennchen/zipstream-php",
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
<x-layouts.auth.card>
|
|
||||||
{{ $slot }}
|
|
||||||
</x-layouts.auth.card>
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
<x-layouts.app.header>
|
<x-layouts::app.header>
|
||||||
<flux:main>
|
<flux:main>
|
||||||
{{ $slot }}
|
{{ $slot }}
|
||||||
</flux:main>
|
</flux:main>
|
||||||
</x-layouts.app.header>
|
</x-layouts::app.header>
|
||||||
3
resources/views/layouts/auth.blade.php
Normal file
3
resources/views/layouts/auth.blade.php
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<x-layouts::auth.card>
|
||||||
|
{{ $slot }}
|
||||||
|
</x-layouts::auth.card>
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use Livewire\Attributes\Layout;
|
use Livewire\Attributes\Layout;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new #[Layout('components.layouts.auth')] class extends Component {
|
new #[Layout('layouts.auth')] class extends Component {
|
||||||
public string $password = '';
|
public string $password = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Password;
|
use Illuminate\Support\Facades\Password;
|
||||||
use Livewire\Attributes\Layout;
|
use Livewire\Attributes\Layout;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new #[Layout('components.layouts.auth')] class extends Component {
|
new #[Layout('layouts.auth')] class extends Component {
|
||||||
public string $email = '';
|
public string $email = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ use Illuminate\Support\Str;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use Livewire\Attributes\Layout;
|
use Livewire\Attributes\Layout;
|
||||||
use Livewire\Attributes\Validate;
|
use Livewire\Attributes\Validate;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new #[Layout('components.layouts.auth')] class extends Component {
|
new #[Layout('layouts.auth')] class extends Component {
|
||||||
#[Validate('required|string|email')]
|
#[Validate('required|string|email')]
|
||||||
public string $email = '';
|
public string $email = '';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Validation\Rules;
|
use Illuminate\Validation\Rules;
|
||||||
use Livewire\Attributes\Layout;
|
use Livewire\Attributes\Layout;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new #[Layout('components.layouts.auth')] class extends Component {
|
new #[Layout('layouts.auth')] class extends Component {
|
||||||
public string $name = '';
|
public string $name = '';
|
||||||
public string $email = '';
|
public string $email = '';
|
||||||
public string $password = '';
|
public string $password = '';
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,9 @@ use Illuminate\Support\Str;
|
||||||
use Illuminate\Validation\Rules;
|
use Illuminate\Validation\Rules;
|
||||||
use Livewire\Attributes\Layout;
|
use Livewire\Attributes\Layout;
|
||||||
use Livewire\Attributes\Locked;
|
use Livewire\Attributes\Locked;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new #[Layout('components.layouts.auth')] class extends Component {
|
new #[Layout('layouts.auth')] class extends Component {
|
||||||
#[Locked]
|
#[Locked]
|
||||||
public string $token = '';
|
public string $token = '';
|
||||||
public string $email = '';
|
public string $email = '';
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ use App\Livewire\Actions\Logout;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
use Livewire\Attributes\Layout;
|
use Livewire\Attributes\Layout;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new #[Layout('components.layouts.auth')] class extends Component {
|
new #[Layout('layouts.auth')] class extends Component {
|
||||||
/**
|
/**
|
||||||
* Send an email verification notification to the user.
|
* Send an email verification notification to the user.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Livewire\Attributes\Lazy;
|
use Livewire\Attributes\Lazy;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
new
|
new
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Livewire\Attributes\Lazy;
|
use Livewire\Attributes\Lazy;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new
|
new
|
||||||
#[Lazy]
|
#[Lazy]
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
use Livewire\Attributes\Modelable;
|
use Livewire\Attributes\Modelable;
|
||||||
|
|
||||||
new class extends Component
|
new class extends Component
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
public function mount()
|
public function mount()
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use App\Models\DeviceModel;
|
use App\Models\DeviceModel;
|
||||||
use App\Models\DevicePalette;
|
use App\Models\DevicePalette;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component
|
new class extends Component
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\DevicePalette;
|
use App\Models\DevicePalette;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component
|
new class extends Component
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ use App\Models\DeviceModel;
|
||||||
use App\Models\Firmware;
|
use App\Models\Firmware;
|
||||||
use App\Models\Playlist;
|
use App\Models\Playlist;
|
||||||
use App\Models\PlaylistItem;
|
use App\Models\PlaylistItem;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use App\Models\Device;
|
use App\Models\Device;
|
||||||
use App\Models\DeviceLog;
|
use App\Models\DeviceLog;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
public Device $device;
|
public Device $device;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use App\Models\Device;
|
use App\Models\Device;
|
||||||
use App\Models\DeviceModel;
|
use App\Models\DeviceModel;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
use App\Models\Device;
|
use App\Models\Device;
|
||||||
use App\Models\Playlist;
|
use App\Models\Playlist;
|
||||||
use App\Models\PlaylistItem;
|
use App\Models\PlaylistItem;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
public $devices;
|
public $devices;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Plugin;
|
use App\Models\Plugin;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Plugin;
|
use App\Models\Plugin;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
public Plugin $plugin;
|
public Plugin $plugin;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Plugin;
|
use App\Models\Plugin;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use App\Console\Commands\ExampleRecipesSeederCommand;
|
use App\Console\Commands\ExampleRecipesSeederCommand;
|
||||||
use App\Services\PluginImportService;
|
use App\Services\PluginImportService;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
use Livewire\WithFileUploads;
|
use Livewire\WithFileUploads;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use App\Jobs\GenerateScreenJob;
|
use App\Jobs\GenerateScreenJob;
|
||||||
use Illuminate\Support\Collection;
|
use Illuminate\Support\Collection;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ use App\Models\Plugin;
|
||||||
use App\Models\DeviceModel;
|
use App\Models\DeviceModel;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Keepsuit\Liquid\Exceptions\LiquidException;
|
use Keepsuit\Liquid\Exceptions\LiquidException;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
use Illuminate\Support\Facades\Blade;
|
use Illuminate\Support\Facades\Blade;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use App\Models\Plugin;
|
use App\Models\Plugin;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This component contains the TRMNL Plugin Settings modal
|
* This component contains the TRMNL Plugin Settings modal
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
//
|
//
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
use App\Livewire\Actions\Logout;
|
use App\Livewire\Actions\Logout;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
public string $password = '';
|
public string $password = '';
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Validation\Rules\Password;
|
use Illuminate\Validation\Rules\Password;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
public string $current_password = '';
|
public string $current_password = '';
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ use Illuminate\Support\Collection;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
public ?int $assign_new_device_id = null;
|
public ?int $assign_new_device_id = null;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ use App\Models\User;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
use Illuminate\Validation\Rule;
|
use Illuminate\Validation\Rule;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Component;
|
||||||
|
|
||||||
new class extends Component {
|
new class extends Component {
|
||||||
public string $name = '';
|
public string $name = '';
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,8 @@
|
||||||
|
<?php
|
||||||
|
use Livewire\Component;
|
||||||
|
new class extends Component {}
|
||||||
|
?>
|
||||||
|
|
||||||
<section class="w-full">
|
<section class="w-full">
|
||||||
@include('partials.settings-heading')
|
@include('partials.settings-heading')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
<x-layouts.auth.card>
|
<x-layouts::auth.card>
|
||||||
<div class="flex flex-col gap-6">
|
<div class="flex flex-col gap-6">
|
||||||
<x-auth-header title="TRMNL BYOS Laravel" description="Server is up and running."/>
|
<x-auth-header title="TRMNL BYOS Laravel" description="Server is up and running."/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -67,4 +67,4 @@
|
||||||
@endif
|
@endif
|
||||||
@endif
|
@endif
|
||||||
@endauth
|
@endauth
|
||||||
</x-layouts.auth.card>
|
</x-layouts::auth.card>
|
||||||
|
|
|
||||||
|
|
@ -3,21 +3,20 @@
|
||||||
use App\Http\Controllers\Auth\OidcController;
|
use App\Http\Controllers\Auth\OidcController;
|
||||||
use App\Http\Controllers\Auth\VerifyEmailController;
|
use App\Http\Controllers\Auth\VerifyEmailController;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
Route::middleware('guest')->group(function () {
|
Route::middleware('guest')->group(function () {
|
||||||
Volt::route('login', 'auth.login')
|
Route::livewire('login', 'auth.login')
|
||||||
->name('login');
|
->name('login');
|
||||||
|
|
||||||
if (config('app.registration.enabled')) {
|
if (config('app.registration.enabled')) {
|
||||||
Volt::route('register', 'auth.register')
|
Route::livewire('register', 'auth.register')
|
||||||
->name('register');
|
->name('register');
|
||||||
}
|
}
|
||||||
|
|
||||||
Volt::route('forgot-password', 'auth.forgot-password')
|
Route::livewire('forgot-password', 'auth.forgot-password')
|
||||||
->name('password.request');
|
->name('password.request');
|
||||||
|
|
||||||
Volt::route('reset-password/{token}', 'auth.reset-password')
|
Route::livewire('reset-password/{token}', 'auth.reset-password')
|
||||||
->name('password.reset');
|
->name('password.reset');
|
||||||
|
|
||||||
// OIDC authentication routes
|
// OIDC authentication routes
|
||||||
|
|
@ -30,14 +29,14 @@ Route::middleware('guest')->group(function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
Route::middleware('auth')->group(function () {
|
Route::middleware('auth')->group(function () {
|
||||||
Volt::route('verify-email', 'auth.verify-email')
|
Route::livewire('verify-email', 'auth.verify-email')
|
||||||
->name('verification.notice');
|
->name('verification.notice');
|
||||||
|
|
||||||
Route::get('verify-email/{id}/{hash}', VerifyEmailController::class)
|
Route::get('verify-email/{id}/{hash}', VerifyEmailController::class)
|
||||||
->middleware(['signed', 'throttle:6,1'])
|
->middleware(['signed', 'throttle:6,1'])
|
||||||
->name('verification.verify');
|
->name('verification.verify');
|
||||||
|
|
||||||
Volt::route('confirm-password', 'auth.confirm-password')
|
Route::livewire('confirm-password', 'auth.confirm-password')
|
||||||
->name('password.confirm');
|
->name('password.confirm');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
use App\Models\Plugin;
|
use App\Models\Plugin;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
Route::get('/', function () {
|
Route::get('/', function () {
|
||||||
return view('welcome');
|
return view('welcome');
|
||||||
|
|
@ -11,29 +10,29 @@ Route::get('/', function () {
|
||||||
|
|
||||||
Route::middleware(['auth'])->group(function () {
|
Route::middleware(['auth'])->group(function () {
|
||||||
Route::redirect('settings', 'settings/preferences');
|
Route::redirect('settings', 'settings/preferences');
|
||||||
Volt::route('settings/preferences', 'settings.preferences')->name('settings.preferences');
|
Route::livewire('settings/preferences', 'settings.preferences')->name('settings.preferences');
|
||||||
Volt::route('settings/profile', 'settings.profile')->name('settings.profile');
|
Route::livewire('settings/profile', 'settings.profile')->name('settings.profile');
|
||||||
Volt::route('settings/password', 'settings.password')->name('settings.password');
|
Route::livewire('settings/password', 'settings.password')->name('settings.password');
|
||||||
Volt::route('settings/appearance', 'settings.appearance')->name('settings.appearance');
|
Route::livewire('settings/appearance', 'settings.appearance')->name('settings.appearance');
|
||||||
Volt::route('settings/support', 'settings.support')->name('settings.support');
|
Route::livewire('settings/support', 'settings.support')->name('settings.support');
|
||||||
|
|
||||||
Volt::route('/dashboard', 'device-dashboard')->name('dashboard');
|
Route::livewire('/dashboard', 'device-dashboard')->name('dashboard');
|
||||||
|
|
||||||
Volt::route('/devices', 'devices.manage')->name('devices');
|
Route::livewire('/devices', 'devices.manage')->name('devices');
|
||||||
Volt::route('/devices/{device}/configure', 'devices.configure')->name('devices.configure');
|
Route::livewire('/devices/{device}/configure', 'devices.configure')->name('devices.configure');
|
||||||
Volt::route('/devices/{device}/logs', 'devices.logs')->name('devices.logs');
|
Route::livewire('/devices/{device}/logs', 'devices.logs')->name('devices.logs');
|
||||||
|
|
||||||
Volt::route('/device-models', 'device-models.index')->name('device-models.index');
|
Route::livewire('/device-models', 'device-models.index')->name('device-models.index');
|
||||||
Volt::route('/device-palettes', 'device-palettes.index')->name('device-palettes.index');
|
Route::livewire('/device-palettes', 'device-palettes.index')->name('device-palettes.index');
|
||||||
|
|
||||||
Volt::route('plugins', 'plugins.index')->name('plugins.index');
|
Route::livewire('plugins', 'plugins.index')->name('plugins.index');
|
||||||
|
|
||||||
Volt::route('plugins/recipe/{plugin}', 'plugins.recipe')->name('plugins.recipe');
|
Route::livewire('plugins/recipe/{plugin}', 'plugins.recipe')->name('plugins.recipe');
|
||||||
Volt::route('plugins/markup', 'plugins.markup')->name('plugins.markup');
|
Route::livewire('plugins/markup', 'plugins.markup')->name('plugins.markup');
|
||||||
Volt::route('plugins/api', 'plugins.api')->name('plugins.api');
|
Route::livewire('plugins/api', 'plugins.api')->name('plugins.api');
|
||||||
Volt::route('plugins/image-webhook', 'plugins.image-webhook')->name('plugins.image-webhook');
|
Route::livewire('plugins/image-webhook', 'plugins.image-webhook')->name('plugins.image-webhook');
|
||||||
Volt::route('plugins/image-webhook/{plugin}', 'plugins.image-webhook-instance')->name('plugins.image-webhook-instance');
|
Route::livewire('plugins/image-webhook/{plugin}', 'plugins.image-webhook-instance')->name('plugins.image-webhook-instance');
|
||||||
Volt::route('playlists', 'playlists.index')->name('playlists.index');
|
Route::livewire('playlists', 'playlists.index')->name('playlists.index');
|
||||||
|
|
||||||
Route::get('plugin_settings/{trmnlp_id}/edit', function (Request $request, string $trmnlp_id) {
|
Route::get('plugin_settings/{trmnlp_id}/edit', function (Request $request, string $trmnlp_id) {
|
||||||
$plugin = Plugin::query()
|
$plugin = Plugin::query()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Livewire\Volt\Volt as LivewireVolt;
|
|
||||||
|
|
||||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
@ -14,7 +13,7 @@ test('login screen can be rendered', function (): void {
|
||||||
test('users can authenticate using the login screen', function (): void {
|
test('users can authenticate using the login screen', function (): void {
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
|
|
||||||
$response = LivewireVolt::test('auth.login')
|
$response = Livewire::test('auth.login')
|
||||||
->set('email', $user->email)
|
->set('email', $user->email)
|
||||||
->set('password', 'password')
|
->set('password', 'password')
|
||||||
->call('login');
|
->call('login');
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
@ -18,7 +17,7 @@ test('password can be confirmed', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = Volt::test('auth.confirm-password')
|
$response = Livewire::test('auth.confirm-password')
|
||||||
->set('password', 'password')
|
->set('password', 'password')
|
||||||
->call('confirmPassword');
|
->call('confirmPassword');
|
||||||
|
|
||||||
|
|
@ -32,7 +31,7 @@ test('password is not confirmed with invalid password', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = Volt::test('auth.confirm-password')
|
$response = Livewire::test('auth.confirm-password')
|
||||||
->set('password', 'wrong-password')
|
->set('password', 'wrong-password')
|
||||||
->call('confirmPassword');
|
->call('confirmPassword');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Auth\Notifications\ResetPassword;
|
use Illuminate\Auth\Notifications\ResetPassword;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use Illuminate\Support\Facades\Notification;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
@ -18,7 +17,7 @@ test('reset password link can be requested', function (): void {
|
||||||
|
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
|
|
||||||
Volt::test('auth.forgot-password')
|
Livewire::test('auth.forgot-password')
|
||||||
->set('email', $user->email)
|
->set('email', $user->email)
|
||||||
->call('sendPasswordResetLink');
|
->call('sendPasswordResetLink');
|
||||||
|
|
||||||
|
|
@ -30,7 +29,7 @@ test('reset password screen can be rendered', function (): void {
|
||||||
|
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
|
|
||||||
Volt::test('auth.forgot-password')
|
Livewire::test('auth.forgot-password')
|
||||||
->set('email', $user->email)
|
->set('email', $user->email)
|
||||||
->call('sendPasswordResetLink');
|
->call('sendPasswordResetLink');
|
||||||
|
|
||||||
|
|
@ -48,12 +47,12 @@ test('password can be reset with valid token', function (): void {
|
||||||
|
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
|
|
||||||
Volt::test('auth.forgot-password')
|
Livewire::test('auth.forgot-password')
|
||||||
->set('email', $user->email)
|
->set('email', $user->email)
|
||||||
->call('sendPasswordResetLink');
|
->call('sendPasswordResetLink');
|
||||||
|
|
||||||
Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user): true {
|
Notification::assertSentTo($user, ResetPassword::class, function ($notification) use ($user): true {
|
||||||
$response = Volt::test('auth.reset-password', ['token' => $notification->token])
|
$response = Livewire::test('auth.reset-password', ['token' => $notification->token])
|
||||||
->set('email', $user->email)
|
->set('email', $user->email)
|
||||||
->set('password', 'password')
|
->set('password', 'password')
|
||||||
->set('password_confirmation', 'password')
|
->set('password_confirmation', 'password')
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||||
|
|
||||||
test('registration screen can be rendered', function (): void {
|
test('registration screen can be rendered', function (): void {
|
||||||
|
|
@ -11,7 +9,7 @@ test('registration screen can be rendered', function (): void {
|
||||||
});
|
});
|
||||||
|
|
||||||
test('new users can register', function (): void {
|
test('new users can register', function (): void {
|
||||||
$response = Volt::test('auth.register')
|
$response = Livewire::test('auth.register')
|
||||||
->set('name', 'Test User')
|
->set('name', 'Test User')
|
||||||
->set('email', 'test@example.com')
|
->set('email', 'test@example.com')
|
||||||
->set('password', 'password')
|
->set('password', 'password')
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
use App\Models\Device;
|
use App\Models\Device;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
@ -27,7 +26,7 @@ test('user can create a new device', function (): void {
|
||||||
'friendly_id' => 'test-device-1',
|
'friendly_id' => 'test-device-1',
|
||||||
];
|
];
|
||||||
|
|
||||||
$response = Volt::test('devices.manage')
|
$response = Livewire::test('devices.manage')
|
||||||
->set('name', $deviceData['name'])
|
->set('name', $deviceData['name'])
|
||||||
->set('mac_address', $deviceData['mac_address'])
|
->set('mac_address', $deviceData['mac_address'])
|
||||||
->set('api_key', $deviceData['api_key'])
|
->set('api_key', $deviceData['api_key'])
|
||||||
|
|
@ -52,7 +51,7 @@ test('device creation requires required fields', function (): void {
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = Volt::test('devices.manage')
|
$response = Livewire::test('devices.manage')
|
||||||
->set('name', '')
|
->set('name', '')
|
||||||
->set('mac_address', '')
|
->set('mac_address', '')
|
||||||
->set('api_key', '')
|
->set('api_key', '')
|
||||||
|
|
@ -75,14 +74,14 @@ test('user can toggle proxy cloud for their device', function (): void {
|
||||||
'proxy_cloud' => false,
|
'proxy_cloud' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$response = Volt::test('devices.manage')
|
$response = Livewire::test('devices.manage')
|
||||||
->call('toggleProxyCloud', $device);
|
->call('toggleProxyCloud', $device);
|
||||||
|
|
||||||
$response->assertHasNoErrors();
|
$response->assertHasNoErrors();
|
||||||
expect($device->fresh()->proxy_cloud)->toBeTrue();
|
expect($device->fresh()->proxy_cloud)->toBeTrue();
|
||||||
|
|
||||||
// Toggle back to false
|
// Toggle back to false
|
||||||
$response = Volt::test('devices.manage')
|
$response = Livewire::test('devices.manage')
|
||||||
->call('toggleProxyCloud', $device);
|
->call('toggleProxyCloud', $device);
|
||||||
|
|
||||||
expect($device->fresh()->proxy_cloud)->toBeFalse();
|
expect($device->fresh()->proxy_cloud)->toBeFalse();
|
||||||
|
|
@ -98,7 +97,7 @@ test('user cannot toggle proxy cloud for other users devices', function (): void
|
||||||
'proxy_cloud' => false,
|
'proxy_cloud' => false,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$response = Volt::test('devices.manage')
|
$response = Livewire::test('devices.manage')
|
||||||
->call('toggleProxyCloud', $device);
|
->call('toggleProxyCloud', $device);
|
||||||
|
|
||||||
$response->assertStatus(403);
|
$response->assertStatus(403);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ use App\Models\User;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Livewire\Livewire;
|
use Livewire\Livewire;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
beforeEach(function (): void {
|
beforeEach(function (): void {
|
||||||
|
|
@ -19,7 +18,7 @@ it('can render catalog component', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
$component = Volt::test('catalog.index');
|
$component = Livewire::test('catalog.index');
|
||||||
|
|
||||||
$component->assertSee('No plugins available');
|
$component->assertSee('No plugins available');
|
||||||
});
|
});
|
||||||
|
|
@ -59,7 +58,7 @@ it('loads plugins from catalog URL', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
$component = Volt::test('catalog.index');
|
$component = Livewire::test('catalog.index');
|
||||||
|
|
||||||
$component->assertSee('Test Plugin');
|
$component->assertSee('Test Plugin');
|
||||||
$component->assertSee('testuser');
|
$component->assertSee('testuser');
|
||||||
|
|
@ -102,7 +101,7 @@ it('hides preview button when screenshot_url is missing', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.index')
|
Livewire::test('catalog.index')
|
||||||
->assertSee('Test Plugin Without Screenshot')
|
->assertSee('Test Plugin Without Screenshot')
|
||||||
->assertDontSeeHtml('variant="subtle" icon="eye"');
|
->assertDontSeeHtml('variant="subtle" icon="eye"');
|
||||||
});
|
});
|
||||||
|
|
@ -114,7 +113,7 @@ it('shows error when plugin not found', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
$component = Volt::test('catalog.index');
|
$component = Livewire::test('catalog.index');
|
||||||
|
|
||||||
$component->call('installPlugin', 'non-existent-plugin');
|
$component->call('installPlugin', 'non-existent-plugin');
|
||||||
|
|
||||||
|
|
@ -146,7 +145,7 @@ it('shows error when zip_url is missing', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
$component = Volt::test('catalog.index');
|
$component = Livewire::test('catalog.index');
|
||||||
|
|
||||||
$component->call('installPlugin', 'test-plugin');
|
$component->call('installPlugin', 'test-plugin');
|
||||||
|
|
||||||
|
|
@ -189,7 +188,7 @@ it('can preview a plugin', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.index')
|
Livewire::test('catalog.index')
|
||||||
->assertSee('Test Plugin')
|
->assertSee('Test Plugin')
|
||||||
->call('previewPlugin', 'test-plugin')
|
->call('previewPlugin', 'test-plugin')
|
||||||
->assertSet('previewingPlugin', 'test-plugin')
|
->assertSet('previewingPlugin', 'test-plugin')
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
use App\Models\Plugin;
|
use App\Models\Plugin;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
uses(RefreshDatabase::class);
|
uses(RefreshDatabase::class);
|
||||||
|
|
@ -28,7 +27,7 @@ test('config modal correctly loads multi_string defaults into UI boxes', functio
|
||||||
'configuration' => ['tags' => 'alpha,beta']
|
'configuration' => ['tags' => 'alpha,beta']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Volt::test('plugins.config-modal', ['plugin' => $plugin])
|
Livewire::test('plugins.config-modal', ['plugin' => $plugin])
|
||||||
->assertSet('multiValues.tags', ['alpha', 'beta']);
|
->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')
|
->set('multiValues.tags.0', 'no,commas,allowed')
|
||||||
->call('saveConfiguration')
|
->call('saveConfiguration')
|
||||||
->assertHasErrors(['multiValues.tags.0' => 'regex']);
|
->assertHasErrors(['multiValues.tags.0' => 'regex']);
|
||||||
|
|
@ -78,7 +77,7 @@ test('config modal merges multi_string boxes into a single CSV string on save',
|
||||||
'configuration' => []
|
'configuration' => []
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Volt::test('plugins.config-modal', ['plugin' => $plugin])
|
Livewire::test('plugins.config-modal', ['plugin' => $plugin])
|
||||||
->set('multiValues.items.0', 'First')
|
->set('multiValues.items.0', 'First')
|
||||||
->call('addMultiItem', 'items')
|
->call('addMultiItem', 'items')
|
||||||
->set('multiValues.items.1', 'Second')
|
->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']
|
'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')
|
->set('configuration.simple_key', 'dirty_value')
|
||||||
->call('resetForm')
|
->call('resetForm')
|
||||||
->assertSet('configuration.simple_key', 'original_value')
|
->assertSet('configuration.simple_key', 'original_value')
|
||||||
|
|
@ -118,7 +117,7 @@ test('config modal dispatches update event for parent warning refresh', function
|
||||||
'data_strategy' => 'static'
|
'data_strategy' => 'static'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Volt::test('plugins.config-modal', ['plugin' => $plugin])
|
Livewire::test('plugins.config-modal', ['plugin' => $plugin])
|
||||||
->call('saveConfiguration')
|
->call('saveConfiguration')
|
||||||
->assertDispatched('config-updated');
|
->assertDispatched('config-updated');
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ use App\Models\Plugin;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
uses(RefreshDatabase::class);
|
uses(RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
@ -21,7 +20,7 @@ test('recipe settings can save trmnlp_id', function (): void {
|
||||||
|
|
||||||
$trmnlpId = (string) Str::uuid();
|
$trmnlpId = (string) Str::uuid();
|
||||||
|
|
||||||
Volt::test('plugins.recipes.settings', ['plugin' => $plugin])
|
Livewire::test('plugins.recipes.settings', ['plugin' => $plugin])
|
||||||
->set('trmnlp_id', $trmnlpId)
|
->set('trmnlp_id', $trmnlpId)
|
||||||
->call('saveTrmnlpId')
|
->call('saveTrmnlpId')
|
||||||
->assertHasNoErrors();
|
->assertHasNoErrors();
|
||||||
|
|
@ -43,7 +42,7 @@ test('recipe settings validates trmnlp_id is unique per user', function (): void
|
||||||
'trmnlp_id' => null,
|
'trmnlp_id' => null,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Volt::test('plugins.recipes.settings', ['plugin' => $newPlugin])
|
Livewire::test('plugins.recipes.settings', ['plugin' => $newPlugin])
|
||||||
->set('trmnlp_id', 'existing-id-123')
|
->set('trmnlp_id', 'existing-id-123')
|
||||||
->call('saveTrmnlpId')
|
->call('saveTrmnlpId')
|
||||||
->assertHasErrors(['trmnlp_id' => 'unique']);
|
->assertHasErrors(['trmnlp_id' => 'unique']);
|
||||||
|
|
@ -67,7 +66,7 @@ test('recipe settings allows same trmnlp_id for different users', function (): v
|
||||||
|
|
||||||
$this->actingAs($user2);
|
$this->actingAs($user2);
|
||||||
|
|
||||||
Volt::test('plugins.recipes.settings', ['plugin' => $plugin2])
|
Livewire::test('plugins.recipes.settings', ['plugin' => $plugin2])
|
||||||
->set('trmnlp_id', 'shared-id-123')
|
->set('trmnlp_id', 'shared-id-123')
|
||||||
->call('saveTrmnlpId')
|
->call('saveTrmnlpId')
|
||||||
->assertHasNoErrors();
|
->assertHasNoErrors();
|
||||||
|
|
@ -86,7 +85,7 @@ test('recipe settings allows same trmnlp_id for the same plugin', function (): v
|
||||||
'trmnlp_id' => $trmnlpId,
|
'trmnlp_id' => $trmnlpId,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Volt::test('plugins.recipes.settings', ['plugin' => $plugin])
|
Livewire::test('plugins.recipes.settings', ['plugin' => $plugin])
|
||||||
->set('trmnlp_id', $trmnlpId)
|
->set('trmnlp_id', $trmnlpId)
|
||||||
->call('saveTrmnlpId')
|
->call('saveTrmnlpId')
|
||||||
->assertHasNoErrors();
|
->assertHasNoErrors();
|
||||||
|
|
@ -103,7 +102,7 @@ test('recipe settings can clear trmnlp_id', function (): void {
|
||||||
'trmnlp_id' => 'some-id',
|
'trmnlp_id' => 'some-id',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Volt::test('plugins.recipes.settings', ['plugin' => $plugin])
|
Livewire::test('plugins.recipes.settings', ['plugin' => $plugin])
|
||||||
->set('trmnlp_id', '')
|
->set('trmnlp_id', '')
|
||||||
->call('saveTrmnlpId')
|
->call('saveTrmnlpId')
|
||||||
->assertHasNoErrors();
|
->assertHasNoErrors();
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
@ -13,7 +12,7 @@ test('password can be updated', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = Volt::test('settings.password')
|
$response = Livewire::test('settings.password')
|
||||||
->set('current_password', 'password')
|
->set('current_password', 'password')
|
||||||
->set('password', 'new-password')
|
->set('password', 'new-password')
|
||||||
->set('password_confirmation', 'new-password')
|
->set('password_confirmation', 'new-password')
|
||||||
|
|
@ -31,7 +30,7 @@ test('correct password must be provided to update password', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = Volt::test('settings.password')
|
$response = Livewire::test('settings.password')
|
||||||
->set('current_password', 'wrong-password')
|
->set('current_password', 'wrong-password')
|
||||||
->set('password', 'new-password')
|
->set('password', 'new-password')
|
||||||
->set('password_confirmation', 'new-password')
|
->set('password_confirmation', 'new-password')
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
@ -16,7 +15,7 @@ test('profile information can be updated', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = Volt::test('settings.profile')
|
$response = Livewire::test('settings.profile')
|
||||||
->set('name', 'Test User')
|
->set('name', 'Test User')
|
||||||
->set('email', 'test@example.com')
|
->set('email', 'test@example.com')
|
||||||
->call('updateProfileInformation');
|
->call('updateProfileInformation');
|
||||||
|
|
@ -35,7 +34,7 @@ test('email verification status is unchanged when email address is unchanged', f
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = Volt::test('settings.profile')
|
$response = Livewire::test('settings.profile')
|
||||||
->set('name', 'Test User')
|
->set('name', 'Test User')
|
||||||
->set('email', $user->email)
|
->set('email', $user->email)
|
||||||
->call('updateProfileInformation');
|
->call('updateProfileInformation');
|
||||||
|
|
@ -50,7 +49,7 @@ test('user can delete their account', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = Volt::test('settings.delete-user-form')
|
$response = Livewire::test('settings.delete-user-form')
|
||||||
->set('password', 'password')
|
->set('password', 'password')
|
||||||
->call('deleteUser');
|
->call('deleteUser');
|
||||||
|
|
||||||
|
|
@ -67,7 +66,7 @@ test('correct password must be provided to delete account', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$response = Volt::test('settings.delete-user-form')
|
$response = Livewire::test('settings.delete-user-form')
|
||||||
->set('password', 'wrong-password')
|
->set('password', 'wrong-password')
|
||||||
->call('deleteUser');
|
->call('deleteUser');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ declare(strict_types=1);
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Livewire\Livewire;
|
use Livewire\Livewire;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
it('loads newest TRMNL recipes on mount', function (): void {
|
it('loads newest TRMNL recipes on mount', function (): void {
|
||||||
Http::fake([
|
Http::fake([
|
||||||
|
|
@ -25,7 +24,7 @@ it('loads newest TRMNL recipes on mount', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.trmnl')
|
Livewire::test('catalog.trmnl')
|
||||||
->assertSee('Weather Chum')
|
->assertSee('Weather Chum')
|
||||||
->assertSee('Install')
|
->assertSee('Install')
|
||||||
->assertDontSeeHtml('variant="subtle" icon="eye"')
|
->assertDontSeeHtml('variant="subtle" icon="eye"')
|
||||||
|
|
@ -50,7 +49,7 @@ it('shows preview button when screenshot_url is provided', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.trmnl')
|
Livewire::test('catalog.trmnl')
|
||||||
->assertSee('Weather Chum')
|
->assertSee('Weather Chum')
|
||||||
->assertSee('Preview');
|
->assertSee('Preview');
|
||||||
});
|
});
|
||||||
|
|
@ -88,7 +87,7 @@ it('searches TRMNL recipes when search term is provided', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.trmnl')
|
Livewire::test('catalog.trmnl')
|
||||||
->assertSee('Initial Recipe')
|
->assertSee('Initial Recipe')
|
||||||
->set('search', 'weather')
|
->set('search', 'weather')
|
||||||
->assertSee('Weather Search Result')
|
->assertSee('Weather Search Result')
|
||||||
|
|
@ -118,7 +117,7 @@ it('installs plugin successfully when user is authenticated', function (): void
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.trmnl')
|
Livewire::test('catalog.trmnl')
|
||||||
->assertSee('Weather Chum')
|
->assertSee('Weather Chum')
|
||||||
->call('installPlugin', '123')
|
->call('installPlugin', '123')
|
||||||
->assertSee('Error installing plugin'); // This will fail because we don't have a real zip file
|
->assertSee('Error installing plugin'); // This will fail because we don't have a real zip file
|
||||||
|
|
@ -142,7 +141,7 @@ it('shows error when user is not authenticated', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.trmnl')
|
Livewire::test('catalog.trmnl')
|
||||||
->assertSee('Weather Chum')
|
->assertSee('Weather Chum')
|
||||||
->call('installPlugin', '123')
|
->call('installPlugin', '123')
|
||||||
->assertStatus(403); // This will return 403 because user is not authenticated
|
->assertStatus(403); // This will return 403 because user is not authenticated
|
||||||
|
|
@ -171,7 +170,7 @@ it('shows error when plugin installation fails', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.trmnl')
|
Livewire::test('catalog.trmnl')
|
||||||
->assertSee('Weather Chum')
|
->assertSee('Weather Chum')
|
||||||
->call('installPlugin', '123')
|
->call('installPlugin', '123')
|
||||||
->assertSee('Error installing plugin'); // This will fail because the zip content is invalid
|
->assertSee('Error installing plugin'); // This will fail because the zip content is invalid
|
||||||
|
|
@ -205,7 +204,7 @@ it('previews a recipe with async fetch', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.trmnl')
|
Livewire::test('catalog.trmnl')
|
||||||
->assertSee('Weather Chum')
|
->assertSee('Weather Chum')
|
||||||
->call('previewRecipe', '123')
|
->call('previewRecipe', '123')
|
||||||
->assertSet('previewingRecipe', '123')
|
->assertSet('previewingRecipe', '123')
|
||||||
|
|
@ -247,7 +246,7 @@ it('supports pagination and loading more recipes', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.trmnl')
|
Livewire::test('catalog.trmnl')
|
||||||
->assertSee('Recipe Page 1')
|
->assertSee('Recipe Page 1')
|
||||||
->assertDontSee('Recipe Page 2')
|
->assertDontSee('Recipe Page 2')
|
||||||
->assertSee('Load next page')
|
->assertSee('Load next page')
|
||||||
|
|
@ -276,7 +275,7 @@ it('resets pagination when search term changes', function (): void {
|
||||||
|
|
||||||
Livewire::withoutLazyLoading();
|
Livewire::withoutLazyLoading();
|
||||||
|
|
||||||
Volt::test('catalog.trmnl')
|
Livewire::test('catalog.trmnl')
|
||||||
->assertSee('Initial 1')
|
->assertSee('Initial 1')
|
||||||
->call('loadMore')
|
->call('loadMore')
|
||||||
->set('search', 'weather')
|
->set('search', 'weather')
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ declare(strict_types=1);
|
||||||
|
|
||||||
use App\Models\DevicePalette;
|
use App\Models\DevicePalette;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Livewire\Volt\Volt;
|
|
||||||
|
|
||||||
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
uses(Illuminate\Foundation\Testing\RefreshDatabase::class);
|
||||||
|
|
||||||
|
|
@ -25,7 +24,7 @@ test('component loads all device palettes on mount', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index');
|
$component = Livewire::test('device-palettes.index');
|
||||||
|
|
||||||
$palettes = $component->get('devicePalettes');
|
$palettes = $component->get('devicePalettes');
|
||||||
expect($palettes)->toHaveCount($initialCount + 3);
|
expect($palettes)->toHaveCount($initialCount + 3);
|
||||||
|
|
@ -36,7 +35,7 @@ test('can open modal to create new device palette', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->call('openDevicePaletteModal');
|
->call('openDevicePaletteModal');
|
||||||
|
|
||||||
$component
|
$component
|
||||||
|
|
@ -51,7 +50,7 @@ test('can create a new device palette', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'test-palette')
|
->set('name', 'test-palette')
|
||||||
->set('description', 'Test Palette Description')
|
->set('description', 'Test Palette Description')
|
||||||
->set('grays', 16)
|
->set('grays', 16)
|
||||||
|
|
@ -76,7 +75,7 @@ test('can create a grayscale-only palette without colors', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'grayscale-palette')
|
->set('name', 'grayscale-palette')
|
||||||
->set('grays', 256)
|
->set('grays', 256)
|
||||||
->set('colors', [])
|
->set('colors', [])
|
||||||
|
|
@ -102,7 +101,7 @@ test('can open modal to edit existing device palette', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->call('openDevicePaletteModal', $palette->id);
|
->call('openDevicePaletteModal', $palette->id);
|
||||||
|
|
||||||
$component
|
$component
|
||||||
|
|
@ -125,7 +124,7 @@ test('can update an existing device palette', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->call('openDevicePaletteModal', $palette->id)
|
->call('openDevicePaletteModal', $palette->id)
|
||||||
->set('name', 'updated-palette')
|
->set('name', 'updated-palette')
|
||||||
->set('description', 'Updated Description')
|
->set('description', 'Updated Description')
|
||||||
|
|
@ -153,7 +152,7 @@ test('can delete a device palette', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->call('deleteDevicePalette', $palette->id);
|
->call('deleteDevicePalette', $palette->id);
|
||||||
|
|
||||||
expect(DevicePalette::find($palette->id))->toBeNull();
|
expect(DevicePalette::find($palette->id))->toBeNull();
|
||||||
|
|
@ -175,7 +174,7 @@ test('can duplicate a device palette', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->call('duplicateDevicePalette', $palette->id);
|
->call('duplicateDevicePalette', $palette->id);
|
||||||
|
|
||||||
$component
|
$component
|
||||||
|
|
@ -192,7 +191,7 @@ test('can add a color to the colors array', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('colorInput', '#FF0000')
|
->set('colorInput', '#FF0000')
|
||||||
->call('addColor');
|
->call('addColor');
|
||||||
|
|
||||||
|
|
@ -207,7 +206,7 @@ test('cannot add duplicate colors', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('colors', ['#FF0000'])
|
->set('colors', ['#FF0000'])
|
||||||
->set('colorInput', '#FF0000')
|
->set('colorInput', '#FF0000')
|
||||||
->call('addColor');
|
->call('addColor');
|
||||||
|
|
@ -222,7 +221,7 @@ test('can add multiple colors', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('colorInput', '#FF0000')
|
->set('colorInput', '#FF0000')
|
||||||
->call('addColor')
|
->call('addColor')
|
||||||
->set('colorInput', '#00FF00')
|
->set('colorInput', '#00FF00')
|
||||||
|
|
@ -239,7 +238,7 @@ test('can remove a color from the colors array', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('colors', ['#FF0000', '#00FF00', '#0000FF'])
|
->set('colors', ['#FF0000', '#00FF00', '#0000FF'])
|
||||||
->call('removeColor', 1);
|
->call('removeColor', 1);
|
||||||
|
|
||||||
|
|
@ -251,7 +250,7 @@ test('removing color reindexes array', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('colors', ['#FF0000', '#00FF00', '#0000FF'])
|
->set('colors', ['#FF0000', '#00FF00', '#0000FF'])
|
||||||
->call('removeColor', 0);
|
->call('removeColor', 0);
|
||||||
|
|
||||||
|
|
@ -271,7 +270,7 @@ test('can open modal in view-only mode for api-sourced palette', function (): vo
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->call('openDevicePaletteModal', $palette->id, true);
|
->call('openDevicePaletteModal', $palette->id, true);
|
||||||
|
|
||||||
$component
|
$component
|
||||||
|
|
@ -284,7 +283,7 @@ test('name is required when creating device palette', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('grays', 16)
|
->set('grays', 16)
|
||||||
->call('saveDevicePalette');
|
->call('saveDevicePalette');
|
||||||
|
|
||||||
|
|
@ -301,7 +300,7 @@ test('name must be unique when creating device palette', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'existing-name')
|
->set('name', 'existing-name')
|
||||||
->set('grays', 16)
|
->set('grays', 16)
|
||||||
->call('saveDevicePalette');
|
->call('saveDevicePalette');
|
||||||
|
|
@ -320,7 +319,7 @@ test('name can be same when updating device palette', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->call('openDevicePaletteModal', $palette->id)
|
->call('openDevicePaletteModal', $palette->id)
|
||||||
->set('grays', 16)
|
->set('grays', 16)
|
||||||
->call('saveDevicePalette');
|
->call('saveDevicePalette');
|
||||||
|
|
@ -333,7 +332,7 @@ test('grays is required when creating device palette', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'test-palette')
|
->set('name', 'test-palette')
|
||||||
->set('grays', null)
|
->set('grays', null)
|
||||||
->call('saveDevicePalette');
|
->call('saveDevicePalette');
|
||||||
|
|
@ -346,7 +345,7 @@ test('grays must be at least 1', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'test-palette')
|
->set('name', 'test-palette')
|
||||||
->set('grays', 0)
|
->set('grays', 0)
|
||||||
->call('saveDevicePalette');
|
->call('saveDevicePalette');
|
||||||
|
|
@ -359,7 +358,7 @@ test('grays must be at most 256', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'test-palette')
|
->set('name', 'test-palette')
|
||||||
->set('grays', 257)
|
->set('grays', 257)
|
||||||
->call('saveDevicePalette');
|
->call('saveDevicePalette');
|
||||||
|
|
@ -372,7 +371,7 @@ test('colors must be valid hex format', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'test-palette')
|
->set('name', 'test-palette')
|
||||||
->set('grays', 16)
|
->set('grays', 16)
|
||||||
->set('colors', ['invalid-color', '#FF0000'])
|
->set('colors', ['invalid-color', '#FF0000'])
|
||||||
|
|
@ -386,7 +385,7 @@ test('color input must be valid hex format when adding color', function (): void
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('colorInput', 'invalid-color')
|
->set('colorInput', 'invalid-color')
|
||||||
->call('addColor');
|
->call('addColor');
|
||||||
|
|
||||||
|
|
@ -398,7 +397,7 @@ test('color input accepts valid hex format', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('colorInput', '#FF0000')
|
->set('colorInput', '#FF0000')
|
||||||
->call('addColor');
|
->call('addColor');
|
||||||
|
|
||||||
|
|
@ -410,7 +409,7 @@ test('color input accepts lowercase hex format', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('colorInput', '#ff0000')
|
->set('colorInput', '#ff0000')
|
||||||
->call('addColor');
|
->call('addColor');
|
||||||
|
|
||||||
|
|
@ -422,7 +421,7 @@ test('description can be null', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'test-palette')
|
->set('name', 'test-palette')
|
||||||
->set('grays', 16)
|
->set('grays', 16)
|
||||||
->set('description', null)
|
->set('description', null)
|
||||||
|
|
@ -439,7 +438,7 @@ test('framework class can be empty string', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'test-palette')
|
->set('name', 'test-palette')
|
||||||
->set('grays', 16)
|
->set('grays', 16)
|
||||||
->set('framework_class', '')
|
->set('framework_class', '')
|
||||||
|
|
@ -456,7 +455,7 @@ test('empty colors array is saved as null', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'test-palette')
|
->set('name', 'test-palette')
|
||||||
->set('grays', 16)
|
->set('grays', 16)
|
||||||
->set('colors', [])
|
->set('colors', [])
|
||||||
|
|
@ -473,7 +472,7 @@ test('component resets form after saving', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'test-palette')
|
->set('name', 'test-palette')
|
||||||
->set('description', 'Test Description')
|
->set('description', 'Test Description')
|
||||||
->set('grays', 16)
|
->set('grays', 16)
|
||||||
|
|
@ -503,7 +502,7 @@ test('component handles palette with null colors when editing', function (): voi
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->call('openDevicePaletteModal', $palette->id);
|
->call('openDevicePaletteModal', $palette->id);
|
||||||
|
|
||||||
$component->assertSet('colors', []);
|
$component->assertSet('colors', []);
|
||||||
|
|
@ -524,7 +523,7 @@ test('component handles palette with string colors when editing', function (): v
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->call('openDevicePaletteModal', $palette->id);
|
->call('openDevicePaletteModal', $palette->id);
|
||||||
|
|
||||||
$component->assertSet('colors', ['#FF0000', '#00FF00']);
|
$component->assertSet('colors', ['#FF0000', '#00FF00']);
|
||||||
|
|
@ -538,7 +537,7 @@ test('component refreshes palette list after creating', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->set('name', 'new-palette')
|
->set('name', 'new-palette')
|
||||||
->set('grays', 16)
|
->set('grays', 16)
|
||||||
->call('saveDevicePalette');
|
->call('saveDevicePalette');
|
||||||
|
|
@ -566,7 +565,7 @@ test('component refreshes palette list after deleting', function (): void {
|
||||||
|
|
||||||
$this->actingAs($user);
|
$this->actingAs($user);
|
||||||
|
|
||||||
$component = Volt::test('device-palettes.index')
|
$component = Livewire::test('device-palettes.index')
|
||||||
->call('deleteDevicePalette', $palette1->id);
|
->call('deleteDevicePalette', $palette1->id);
|
||||||
|
|
||||||
$palettes = $component->get('devicePalettes');
|
$palettes = $component->get('devicePalettes');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue