Skip to content

Commit

Permalink
add tests for custom stub generation
Browse files Browse the repository at this point in the history
  • Loading branch information
mokhosh committed Oct 1, 2024
1 parent af53299 commit 8fb2a68
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/Tests/KanbanBoardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,21 @@
->toContainAsFile('class TestBoard extends KanbanBoard');
});

it('can make kanban board from custom stub', function () {
File::delete($this->app->basePath('app/Filament/Pages/TestBoard.php'));
File::delete($this->app->basePath('stubs/filament-kanban/board.stub'));
File::ensureDirectoryExists($this->app->basePath('/stubs/filament-kanban/'));
File::put($this->app->basePath('/stubs/filament-kanban/board.stub'), 'custom stub');

$pagesPath = $this->app->basePath('app/Filament/Pages');

$this->artisan('make:kanban TestBoard')->assertExitCode(0);

expect($pagesPath . '/TestBoard.php')
->toBeFile()
->toContainAsFile('custom stub');
});

it('loads statuses', function () {
$statuses = TaskStatus::statuses()
->pluck('title')
Expand Down

0 comments on commit 8fb2a68

Please sign in to comment.