Skip to content

Commit

Permalink
Add Attributes Check For ViewComponentColumn (#2076)
Browse files Browse the repository at this point in the history
* Add Attributes Check For ViewComponentColumn

* Fix styling

---------

Co-authored-by: lrljoe <[email protected]>
  • Loading branch information
lrljoe and lrljoe authored Nov 20, 2024
1 parent adbf41a commit 647687e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/Unit/Views/Columns/ViewComponentColumnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,18 @@ public function test_can_use_custom_component(): void
}*/

public function test_can_not_user_as_label(): void
public function test_can_not_use_as_label(): void
{
$this->expectException(DataTableConfigurationException::class);

$column = ViewComponentColumn::make('Total Users')->label(fn () => 'My Label')->getContents(Pet::find(1));
}

public function test_can_not_return_invalid_attributes(): void
{
$this->expectException(DataTableConfigurationException::class);

$column = ViewComponentColumn::make('Total Users')->attributes(fn ($value, $row, Column $column) => 'test')->getContents(Pet::find(1));

}
}

0 comments on commit 647687e

Please sign in to comment.