Skip to content

Commit 733c2ee

Browse files
committed
Add ComponentColumn invalid attributes test
1 parent 136210d commit 733c2ee

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/Unit/Views/Columns/ComponentColumnTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,18 @@ public function test_can_get_attributes(): void
9494
$this->assertSame(2, $pet2_contents->getData()['attributes']['age']);
9595

9696
}
97+
98+
public function test_can_not_return_invalid_attributes_return(): void
99+
{
100+
$this->expectException(DataTableConfigurationException::class);
101+
102+
$column = ComponentColumn::make('Total Users')
103+
->component('livewire-tables-test::test')
104+
->attributes(fn ($value, $row, Column $column) => (string) 'test');
105+
106+
$contents = $column->getContents(Pet::find(1));
107+
108+
$this->assertSame('<div>2420</div>', $contents);
109+
110+
}
97111
}

0 commit comments

Comments
 (0)