Skip to content

Commit a4ba973

Browse files
authored
test(view): add class attribute merging test (#1599)
1 parent a84ce29 commit a4ba973

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/Integration/View/ViewComponentTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,21 @@ public function test_merge_class(): void
682682
HTML, $html);
683683
}
684684

685+
public function test_merge_class_from_template_to_component(): void
686+
{
687+
$this->registerViewComponent('x-test', <<<'HTML'
688+
<div class="bg-gray-200"></div>
689+
HTML);
690+
691+
$html = $this->render(<<<'HTML'
692+
<x-test class="bg-red-500"></x-test>
693+
HTML);
694+
695+
$this->assertSnippetsMatch(<<<'HTML'
696+
<div class="bg-gray-200 bg-red-500"></div>
697+
HTML, $html);
698+
}
699+
685700
public function test_does_not_duplicate_br(): void
686701
{
687702
$this->registerViewComponent('x-html-base', <<<'HTML'

0 commit comments

Comments
 (0)