diff --git a/tests/Tests/KanbanBoardTest.php b/tests/Tests/KanbanBoardTest.php index 73ebe6e..32bd0b1 100644 --- a/tests/Tests/KanbanBoardTest.php +++ b/tests/Tests/KanbanBoardTest.php @@ -35,6 +35,36 @@ ->toContainAsFile('custom stub'); }); +it('can make force recreate kanban board ', function () { + File::delete($this->app->basePath('app/Filament/Pages/TestBoard.php')); + File::delete($this->app->basePath('stubs/filament-kanban/board.stub')); + $pagesPath = $this->app->basePath('app/Filament/Pages'); + + $this->artisan('make:kanban TestBoard')->assertExitCode(0); + + expect($pagesPath . '/TestBoard.php') + ->toBeFile() + ->toContainAsFile('class TestBoard extends KanbanBoard'); + + File::ensureDirectoryExists($this->app->basePath('/stubs/filament-kanban/')); + File::put($this->app->basePath('/stubs/filament-kanban/board.stub'), 'custom stub'); + + $this->artisan('make:kanban TestBoard')->assertExitCode(0); + + expect($pagesPath . '/TestBoard.php') + ->toBeFile() + ->not->toContainAsFile('custom stub'); + + $this->artisan('make:kanban', [ + 'name' => 'TestBoard', + '--force' => true, + ])->assertExitCode(0); + + expect($pagesPath . '/TestBoard.php') + ->toBeFile() + ->toContainAsFile('custom stub'); +}); + it('loads statuses', function () { $statuses = TaskStatus::statuses() ->pluck('title')