From 647687e9acb1fe319a5322bee60aba486d6542f1 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Wed, 20 Nov 2024 03:07:35 +0000 Subject: [PATCH] Add Attributes Check For ViewComponentColumn (#2076) * Add Attributes Check For ViewComponentColumn * Fix styling --------- Co-authored-by: lrljoe --- tests/Unit/Views/Columns/ViewComponentColumnTest.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/Unit/Views/Columns/ViewComponentColumnTest.php b/tests/Unit/Views/Columns/ViewComponentColumnTest.php index 5d3055cbd..eb6759b16 100644 --- a/tests/Unit/Views/Columns/ViewComponentColumnTest.php +++ b/tests/Unit/Views/Columns/ViewComponentColumnTest.php @@ -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)); + + } }