Skip to content

Commit

Permalink
add test for force make board
Browse files Browse the repository at this point in the history
  • Loading branch information
mokhosh committed Oct 2, 2024
1 parent b1d8c19 commit 9a86b5a
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/Tests/KanbanBoardTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 9a86b5a

Please sign in to comment.