Skip to content

Commit df83fd5

Browse files
committed
Add failing test
1 parent dcc2401 commit df83fd5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

tests/Integration/View/ViewComponentTest.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,4 +710,28 @@ private function assertSnippetsMatch(string $expected, string $actual): void
710710

711711
$this->assertSame($expected, $actual);
712712
}
713+
714+
public function test_multiple_instances_of_custom_component_using_slots(): void
715+
{
716+
$this->registerViewComponent('x-foo-bar', 'FOO-BAR');
717+
718+
$this->registerViewComponent('x-test', <<<'HTML'
719+
<div>
720+
<x-foo-bar />
721+
<x-slot name="test" />
722+
</div>
723+
HTML);
724+
725+
$html = $this->render(<<<'HTML'
726+
<x-test>
727+
<x-slot name="test">
728+
<x-foo-bar />
729+
</x-slot>
730+
</x-test>
731+
HTML);
732+
ld($html);
733+
$this->assertStringEqualsStringIgnoringLineEndings(<<<'HTML'
734+
735+
HTML, $html);
736+
}
713737
}

0 commit comments

Comments
 (0)