From 9fe8a66d5900274cbaf7ceb51af45215953dea4b Mon Sep 17 00:00:00 2001 From: Pieter Naber Date: Sun, 18 Feb 2024 22:12:05 +0100 Subject: [PATCH] Fixed some tests. --- build/report.junit.xml | 250 +--------------------- src/LivewireKanbanBoard.php | 5 +- tests/SampleLivewireKanbanBoardTest.php | 117 ++++++---- tests/stubs/SampleLivewireKanbanBoard.php | 26 ++- 4 files changed, 101 insertions(+), 297 deletions(-) diff --git a/build/report.junit.xml b/build/report.junit.xml index c8e283a..d6eafbc 100644 --- a/build/report.junit.xml +++ b/build/report.junit.xml @@ -1,247 +1,15 @@ - - - - + + + + - - - Mantix\LivewireKanbanBoard\Tests\SampleLivewireKanbanBoardTest::can_build_component -Livewire\Exceptions\PropertyNotFoundException: Property [$id] not found on component: [4266128130] - -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Component.php:105 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\src\LivewireKanbanBoard.php:129 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Collections\Arr.php:588 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Collections\Collection.php:777 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\src\LivewireKanbanBoard.php:128 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\Util.php:41 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:93 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:35 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Wrapped.php:23 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:269 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:229 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:52 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\LivewireManager.php:72 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\orchestra\testbench-core\laravel\storage\framework\views\75c1b4974497b1e03e7915b22e08fdf0.php:7 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:124 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:125 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php:58 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\ExtendBlade\ExtendedCompilerEngine.php:22 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php:72 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\ExtendBlade\ExtendedCompilerEngine.php:10 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:207 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:190 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:159 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Compilers\BladeCompiler.php:335 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:355 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:25 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\CallableDispatcher.php:40 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Route.php:237 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Route.php:208 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:806 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:119 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:805 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:784 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:748 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:737 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:200 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:119 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:175 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\MakesHttpRequests.php:585 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:33 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\RequestBroker.php:30 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:32 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\Render.php:24 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:31 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:17 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\Testable.php:34 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\LivewireManager.php:184 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:355 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\tests\SampleLivewireKanbanBoardTest.php:11 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\tests\SampleLivewireKanbanBoardTest.php:19 - - - Mantix\LivewireKanbanBoard\Tests\SampleLivewireKanbanBoardTest::should_call_record_click -Livewire\Exceptions\PropertyNotFoundException: Property [$id] not found on component: [4266128130] - -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Component.php:105 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\src\LivewireKanbanBoard.php:129 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Collections\Arr.php:588 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Collections\Collection.php:777 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\src\LivewireKanbanBoard.php:128 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\Util.php:41 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:93 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:35 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Wrapped.php:23 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:269 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:229 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:52 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\LivewireManager.php:72 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\orchestra\testbench-core\laravel\storage\framework\views\75c1b4974497b1e03e7915b22e08fdf0.php:7 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:124 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:125 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php:58 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\ExtendBlade\ExtendedCompilerEngine.php:22 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php:72 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\ExtendBlade\ExtendedCompilerEngine.php:10 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:207 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:190 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:159 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Compilers\BladeCompiler.php:335 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:355 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:25 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\CallableDispatcher.php:40 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Route.php:237 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Route.php:208 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:806 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:119 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:805 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:784 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:748 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:737 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:200 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:119 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:175 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\MakesHttpRequests.php:585 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:33 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\RequestBroker.php:30 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:32 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\Render.php:24 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:31 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:17 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\Testable.php:34 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\LivewireManager.php:184 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:355 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\tests\SampleLivewireKanbanBoardTest.php:11 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\tests\SampleLivewireKanbanBoardTest.php:40 - - - Mantix\LivewireKanbanBoard\Tests\SampleLivewireKanbanBoardTest::should_trigger_onStatusSorted -Livewire\Exceptions\PropertyNotFoundException: Property [$id] not found on component: [4266128130] - -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Component.php:105 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\src\LivewireKanbanBoard.php:129 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Collections\Arr.php:588 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Collections\Collection.php:777 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\src\LivewireKanbanBoard.php:128 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\Util.php:41 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:93 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:35 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Wrapped.php:23 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:269 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:229 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:52 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\LivewireManager.php:72 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\orchestra\testbench-core\laravel\storage\framework\views\75c1b4974497b1e03e7915b22e08fdf0.php:7 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:124 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:125 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php:58 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\ExtendBlade\ExtendedCompilerEngine.php:22 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php:72 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\ExtendBlade\ExtendedCompilerEngine.php:10 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:207 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:190 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:159 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Compilers\BladeCompiler.php:335 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:355 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:25 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\CallableDispatcher.php:40 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Route.php:237 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Route.php:208 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:806 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:119 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:805 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:784 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:748 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:737 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:200 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:119 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:175 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\MakesHttpRequests.php:585 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:33 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\RequestBroker.php:30 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:32 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\Render.php:24 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:31 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:17 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\Testable.php:34 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\LivewireManager.php:184 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:355 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\tests\SampleLivewireKanbanBoardTest.php:11 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\tests\SampleLivewireKanbanBoardTest.php:56 - - - Mantix\LivewireKanbanBoard\Tests\SampleLivewireKanbanBoardTest::should_trigger_onStatusChanged -Livewire\Exceptions\PropertyNotFoundException: Property [$id] not found on component: [4266128130] - -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Component.php:105 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\src\LivewireKanbanBoard.php:129 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Collections\Arr.php:588 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Collections\Collection.php:777 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\src\LivewireKanbanBoard.php:128 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\Util.php:41 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:93 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:35 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Wrapped.php:23 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:269 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:229 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\HandleComponents\HandleComponents.php:52 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\LivewireManager.php:72 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\orchestra\testbench-core\laravel\storage\framework\views\75c1b4974497b1e03e7915b22e08fdf0.php:7 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:124 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php:125 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php:58 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\ExtendBlade\ExtendedCompilerEngine.php:22 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php:72 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Mechanisms\ExtendBlade\ExtendedCompilerEngine.php:10 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:207 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:190 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\View.php:159 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\View\Compilers\BladeCompiler.php:335 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:355 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:25 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\CallableDispatcher.php:40 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Route.php:237 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Route.php:208 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:806 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:119 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:805 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:784 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:748 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Routing\Router.php:737 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:200 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:119 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:175 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:144 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Foundation\Testing\Concerns\MakesHttpRequests.php:585 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:33 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\RequestBroker.php:30 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:32 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\Render.php:24 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:31 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\InitialRender.php:17 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\Features\SupportTesting\Testable.php:34 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\livewire\livewire\src\LivewireManager.php:184 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:355 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\tests\SampleLivewireKanbanBoardTest.php:11 -C:\Users\ptgna\OneDrive\Mantix\Websites\livewire-kanban-board\tests\SampleLivewireKanbanBoardTest.php:70 - + + + + + diff --git a/src/LivewireKanbanBoard.php b/src/LivewireKanbanBoard.php index 777f103..3a62769 100644 --- a/src/LivewireKanbanBoard.php +++ b/src/LivewireKanbanBoard.php @@ -126,8 +126,9 @@ public function render() { $statuses = $statuses ->map(function ($status) use ($records) { - $status['group'] = $this->id; - $status['statusRecordsId'] = "{$this->id}-{$status['id']}"; + $id = $this->id ?? 0; + $status['group'] = $id; + $status['statusRecordsId'] = "{$id}-{$status['id']}"; $status['records'] = $records ->filter(function ($record) use ($status) { return $this->isRecordInStatus($record, $status); diff --git a/tests/SampleLivewireKanbanBoardTest.php b/tests/SampleLivewireKanbanBoardTest.php index 4f8273b..b94a596 100644 --- a/tests/SampleLivewireKanbanBoardTest.php +++ b/tests/SampleLivewireKanbanBoardTest.php @@ -13,68 +13,105 @@ private function createComponent($parameters = []): Testable { /** @test */ public function can_build_component() { - //Arrange + // Arrange - //Act + // Act $component = $this->createComponent(); - //Assert - $this->assertNotNull($component); - - //$this->assertTrue($component->statuses()->pluck('id')->contains('todo')); - /*$this->assertCount( - 1, - $component->statuses()->where('id', 'todo')->first()['records'] - );*/ - - //$this->assertTrue($component->statuses()->pluck('id')->contains('completed')); - /*$this->assertCount( - 2, - $component->entangled('statuses')->where('id', 'completed')->first()['records'] - );*/ + // Assert + $component->assertStatus(200); + + // Check statuses + $component->assertViewHas( + 'statuses', + function ($statuses) { + return count($statuses) == 3; + } + ); + + // Check records + $component->assertViewHas( + 'records', + function ($records) { + return count($records) == 3; + } + ); } /** @test */ public function should_call_record_click() { - //Arrange + // Arrange $component = $this->createComponent([ 'recordClickEnabled' => true, ]); - $this->assertFalse($component->entangled('recordClicked')); - - //Act - $component->runAction('onRecordClick', $component->entangled('statuses')->get(0)['records'][0]['id']); - - //Assert - $this->assertTrue($component->entangled('recordClicked')); + // Assert + $component->assertViewHas( + 'recordClicked', + function ($recordClicked) { + return $recordClicked === false; + } + ); + + // Act + $component->call('onRecordClick', 'test'); + + // Assert + $component->assertViewHas( + 'recordClicked', + function ($recordClicked) { + return $recordClicked === true; + } + ); } /** @test */ public function should_trigger_onStatusSorted() { - //Arrange + // Arrange $component = $this->createComponent(); - $this->assertFalse($component->entangled('statusSortedCalled')); - - //Act - $component->runAction('onStatusSorted', null, null, null); - - //Assert - $this->assertTrue($component->entangled('statusSortedCalled')); + // Assert + $component->assertViewHas( + 'statusSortedCalled', + function ($statusSortedCalled) { + return $statusSortedCalled === false; + } + ); + + // Act + $component->call('onStatusSorted', null, null, null); + + // Assert + $component->assertViewHas( + 'statusSortedCalled', + function ($statusSortedCalled) { + return $statusSortedCalled === true; + } + ); } /** @test */ public function should_trigger_onStatusChanged() { - //Arrange + // Arrange $component = $this->createComponent(); - $this->assertFalse($component->entangled('statusChangedCalled')); - - //Act - $component->runAction('onStatusChanged', null, null, null, null); - - //Assert - $this->assertTrue($component->entangled('statusChangedCalled')); + // Assert + $component->assertViewHas( + 'statusChangedCalled', + function ($statusChangedCalled) { + return $statusChangedCalled === false; + } + ); + + // Act + $component->call('onStatusChanged', null, null, null, null); + + // Assert + $component->assertViewHas( + 'statusChangedCalled', + function ($statusChangedCalled) { + return $statusChangedCalled === true; + } + ); } } diff --git a/tests/stubs/SampleLivewireKanbanBoard.php b/tests/stubs/SampleLivewireKanbanBoard.php index 3d13fb1..17e53c6 100644 --- a/tests/stubs/SampleLivewireKanbanBoard.php +++ b/tests/stubs/SampleLivewireKanbanBoard.php @@ -3,13 +3,9 @@ namespace Mantix\LivewireKanbanBoard\Tests\Stubs; use Mantix\LivewireKanbanBoard\LivewireKanbanBoard; -use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Support\Collection; -use Ramsey\Uuid\Uuid; class SampleLivewireKanbanBoard extends LivewireKanbanBoard { - use WithFaker; - public $recordClicked = false; public $statusSortedCalled = false; public $statusChangedCalled = false; @@ -21,32 +17,34 @@ public function statuses(): Collection { 'title' => 'To Do', ], [ - 'id' => 'completed', - 'title' => 'Completed', + 'id' => 'doing', + 'title' => 'Doing', + ], + [ + 'id' => 'done', + 'title' => 'Done', ], ]); } public function records(): Collection { - $this->setUpFaker(); - return collect([ [ - 'id' => Uuid::uuid4()->toString(), + 'id' => fake()->uuid(), 'status' => 'todo', - 'title' => $this->faker->name, + 'title' => fake()->name(), 'clicked' => false, ], [ - 'id' => Uuid::uuid4()->toString(), + 'id' => fake()->uuid(), 'status' => 'completed', - 'title' => $this->faker->name, + 'title' => fake()->name(), 'clicked' => false, ], [ - 'id' => Uuid::uuid4()->toString(), + 'id' => fake()->uuid(), 'status' => 'completed', - 'title' => $this->faker->name, + 'title' => fake()->name(), 'clicked' => false, ], ]);