From 849d909d70da032f5d624a573b2e14ae2ed46cdb Mon Sep 17 00:00:00 2001 From: jordyvanderhaegen Date: Mon, 4 Dec 2023 16:24:18 +0100 Subject: [PATCH] Update: support component attributes --- .../components/data-layer-variable.blade.php | 4 +++- .../components/facebook-pixel-script.blade.php | 7 ++++++- .../facebook-pixel-tracking-event.blade.php | 9 ++++++++- .../View/Components/DataLayerVariableTest.php | 13 +++++++++++++ .../View/Components/FacebookPixelScriptTest.php | 13 +++++++++++++ .../FacebookPixelTrackingEventTest.php | 16 ++++++++++++++++ 6 files changed, 59 insertions(+), 3 deletions(-) diff --git a/resources/views/components/data-layer-variable.blade.php b/resources/views/components/data-layer-variable.blade.php index 9f84b36..199b2e0 100644 --- a/resources/views/components/data-layer-variable.blade.php +++ b/resources/views/components/data-layer-variable.blade.php @@ -1,4 +1,6 @@ - \ No newline at end of file diff --git a/resources/views/components/facebook-pixel-script.blade.php b/resources/views/components/facebook-pixel-script.blade.php index 42f03b4..3777e4d 100644 --- a/resources/views/components/facebook-pixel-script.blade.php +++ b/resources/views/components/facebook-pixel-script.blade.php @@ -1,4 +1,9 @@ - \ No newline at end of file diff --git a/tests/Feature/View/Components/DataLayerVariableTest.php b/tests/Feature/View/Components/DataLayerVariableTest.php index e0e6f88..ca79c52 100644 --- a/tests/Feature/View/Components/DataLayerVariableTest.php +++ b/tests/Feature/View/Components/DataLayerVariableTest.php @@ -36,4 +36,17 @@ public function it_can_render_anonymously() $view->assertSee('window.dataLayer.push({"event":"contact"});', false); } + + /** @test */ + public function it_can_pass_component_attributes() + { + $view = $this->blade(' + + '); + + $view->assertSee('