Skip to content

Commit 08adfd3

Browse files
authored
Add Attributes Check For ViewComponentColumn
1 parent adbf41a commit 08adfd3

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/Unit/Views/Columns/ViewComponentColumnTest.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,18 @@ public function test_can_use_custom_component(): void
7878
7979
}*/
8080

81-
public function test_can_not_user_as_label(): void
81+
public function test_can_not_use_as_label(): void
8282
{
8383
$this->expectException(DataTableConfigurationException::class);
8484

8585
$column = ViewComponentColumn::make('Total Users')->label(fn () => 'My Label')->getContents(Pet::find(1));
8686
}
87+
88+
public function test_can_not_return_invalid_attributes(): void
89+
{
90+
$this->expectException(DataTableConfigurationException::class);
91+
92+
$column = ViewComponentColumn::make('Total Users')->attributes(fn ($value, $row, Column $column) => "test")->getContents(Pet::find(1));
93+
94+
}
8795
}

0 commit comments

Comments
 (0)