From 472963ebdd108a15e83d71664d0578fffa9c3856 Mon Sep 17 00:00:00 2001 From: Ron Chaplin Date: Fri, 5 Apr 2024 12:19:30 -0500 Subject: [PATCH 01/10] lwb-10 Implement address sections component --- .gitignore | 3 + resources/views/sections/address.blade.php | 3 + resources/views/sections/article.blade.php | 4 +- resources/views/sections/aside.blade.php | 3 + src/Components/Sections/Address.php | 41 ++++++ src/Components/Sections/Aside.php | 41 ++++++ tests/Feature/Sections/AddressTest.php | 119 ++++++++++++++++++ tests/Feature/Sections/AsideTest.php | 119 ++++++++++++++++++ .../Components/Sections/MyAddress.php | 9 ++ .../Components/Sections/MyAside.php | 9 ++ 10 files changed, 349 insertions(+), 2 deletions(-) create mode 100644 resources/views/sections/address.blade.php create mode 100644 resources/views/sections/aside.blade.php create mode 100644 src/Components/Sections/Address.php create mode 100644 src/Components/Sections/Aside.php create mode 100644 tests/Feature/Sections/AddressTest.php create mode 100644 tests/Feature/Sections/AsideTest.php create mode 100644 tests/TestSupport/Components/Sections/MyAddress.php create mode 100644 tests/TestSupport/Components/Sections/MyAside.php diff --git a/.gitignore b/.gitignore index be4acd79..a2b0def2 100755 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,6 @@ testbench.yaml vendor node_modules /create_issues.sh +/perform_sections.sh +/generate_section.sh +/replace_and_create.sh diff --git a/resources/views/sections/address.blade.php b/resources/views/sections/address.blade.php new file mode 100644 index 00000000..1440c2df --- /dev/null +++ b/resources/views/sections/address.blade.php @@ -0,0 +1,3 @@ +
+ {{ $slot }} +
diff --git a/resources/views/sections/article.blade.php b/resources/views/sections/article.blade.php index 80bb6753..a1a45c7f 100755 --- a/resources/views/sections/article.blade.php +++ b/resources/views/sections/article.blade.php @@ -1,3 +1,3 @@ -
+
{{ $slot }} -
+ diff --git a/resources/views/sections/aside.blade.php b/resources/views/sections/aside.blade.php new file mode 100644 index 00000000..db6e36bc --- /dev/null +++ b/resources/views/sections/aside.blade.php @@ -0,0 +1,3 @@ + diff --git a/src/Components/Sections/Address.php b/src/Components/Sections/Address.php new file mode 100644 index 00000000..abd80e70 --- /dev/null +++ b/src/Components/Sections/Address.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.address', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/src/Components/Sections/Aside.php b/src/Components/Sections/Aside.php new file mode 100644 index 00000000..5ee00933 --- /dev/null +++ b/src/Components/Sections/Aside.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.aside', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/tests/Feature/Sections/AddressTest.php b/tests/Feature/Sections/AddressTest.php new file mode 100644 index 00000000..91b312f9 --- /dev/null +++ b/tests/Feature/Sections/AddressTest.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyAddress::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyAddress::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyAddress::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyAddress::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyAddress::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyAddress::class, ['data' => ['name' => 'main-address']]) + ->assertSee('data-name="main-address"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyAddress::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyAddress::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyAddress::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyAddress::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyAddress::class, ['id' => 'main-address']) + ->assertSee('id="main-address"', false); +}); + +it('can render with language', function () { + Livewire::test(MyAddress::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyAddress::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyAddress::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyAddress::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyAddress::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyAddress::class, ['slotAttribute' => 'main-address']) + ->assertSee('slot="main-address"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyAddress::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyAddress::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyAddress::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyAddress::class, ['title' => 'main-address']) + ->assertSee('title="main-address"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyAddress::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/Feature/Sections/AsideTest.php b/tests/Feature/Sections/AsideTest.php new file mode 100644 index 00000000..7c735c4a --- /dev/null +++ b/tests/Feature/Sections/AsideTest.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyAside::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyAside::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyAside::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyAside::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyAside::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyAside::class, ['data' => ['name' => 'main-aside']]) + ->assertSee('data-name="main-aside"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyAside::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyAside::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyAside::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyAside::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyAside::class, ['id' => 'main-aside']) + ->assertSee('id="main-aside"', false); +}); + +it('can render with language', function () { + Livewire::test(MyAside::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyAside::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyAside::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyAside::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyAside::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyAside::class, ['slotAttribute' => 'main-aside']) + ->assertSee('slot="main-aside"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyAside::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyAside::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyAside::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyAside::class, ['title' => 'main-aside']) + ->assertSee('title="main-aside"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyAside::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/TestSupport/Components/Sections/MyAddress.php b/tests/TestSupport/Components/Sections/MyAddress.php new file mode 100644 index 00000000..70337c3f --- /dev/null +++ b/tests/TestSupport/Components/Sections/MyAddress.php @@ -0,0 +1,9 @@ + Date: Fri, 5 Apr 2024 12:19:38 -0500 Subject: [PATCH 02/10] lwb-12 Implement footer sections component --- resources/views/sections/footer.blade.php | 3 + src/Components/Sections/Footer.php | 41 ++++++ tests/Feature/Sections/FooterTest.php | 119 ++++++++++++++++++ .../Components/Sections/MyFooter.php | 9 ++ 4 files changed, 172 insertions(+) create mode 100644 resources/views/sections/footer.blade.php create mode 100644 src/Components/Sections/Footer.php create mode 100644 tests/Feature/Sections/FooterTest.php create mode 100644 tests/TestSupport/Components/Sections/MyFooter.php diff --git a/resources/views/sections/footer.blade.php b/resources/views/sections/footer.blade.php new file mode 100644 index 00000000..55db475e --- /dev/null +++ b/resources/views/sections/footer.blade.php @@ -0,0 +1,3 @@ + diff --git a/src/Components/Sections/Footer.php b/src/Components/Sections/Footer.php new file mode 100644 index 00000000..046f73f1 --- /dev/null +++ b/src/Components/Sections/Footer.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.footer', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/tests/Feature/Sections/FooterTest.php b/tests/Feature/Sections/FooterTest.php new file mode 100644 index 00000000..7354b8dd --- /dev/null +++ b/tests/Feature/Sections/FooterTest.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyFooter::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyFooter::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyFooter::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyFooter::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyFooter::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyFooter::class, ['data' => ['name' => 'main-footer']]) + ->assertSee('data-name="main-footer"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyFooter::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyFooter::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyFooter::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyFooter::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyFooter::class, ['id' => 'main-footer']) + ->assertSee('id="main-footer"', false); +}); + +it('can render with language', function () { + Livewire::test(MyFooter::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyFooter::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyFooter::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyFooter::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyFooter::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyFooter::class, ['slotAttribute' => 'main-footer']) + ->assertSee('slot="main-footer"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyFooter::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyFooter::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyFooter::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyFooter::class, ['title' => 'main-footer']) + ->assertSee('title="main-footer"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyFooter::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/TestSupport/Components/Sections/MyFooter.php b/tests/TestSupport/Components/Sections/MyFooter.php new file mode 100644 index 00000000..6e3081c3 --- /dev/null +++ b/tests/TestSupport/Components/Sections/MyFooter.php @@ -0,0 +1,9 @@ + Date: Fri, 5 Apr 2024 12:19:43 -0500 Subject: [PATCH 03/10] lwb-13 Implement header sections component --- resources/views/sections/header.blade.php | 3 + src/Components/Sections/Header.php | 41 ++++++ tests/Feature/Sections/HeaderTest.php | 119 ++++++++++++++++++ .../Components/Sections/MyHeader.php | 9 ++ 4 files changed, 172 insertions(+) create mode 100644 resources/views/sections/header.blade.php create mode 100644 src/Components/Sections/Header.php create mode 100644 tests/Feature/Sections/HeaderTest.php create mode 100644 tests/TestSupport/Components/Sections/MyHeader.php diff --git a/resources/views/sections/header.blade.php b/resources/views/sections/header.blade.php new file mode 100644 index 00000000..504042dd --- /dev/null +++ b/resources/views/sections/header.blade.php @@ -0,0 +1,3 @@ +
+ {{ $slot }} +
diff --git a/src/Components/Sections/Header.php b/src/Components/Sections/Header.php new file mode 100644 index 00000000..2ad19f29 --- /dev/null +++ b/src/Components/Sections/Header.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.header', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/tests/Feature/Sections/HeaderTest.php b/tests/Feature/Sections/HeaderTest.php new file mode 100644 index 00000000..3ce52c05 --- /dev/null +++ b/tests/Feature/Sections/HeaderTest.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyHeader::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyHeader::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyHeader::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyHeader::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyHeader::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyHeader::class, ['data' => ['name' => 'main-header']]) + ->assertSee('data-name="main-header"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyHeader::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyHeader::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyHeader::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyHeader::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyHeader::class, ['id' => 'main-header']) + ->assertSee('id="main-header"', false); +}); + +it('can render with language', function () { + Livewire::test(MyHeader::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyHeader::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyHeader::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyHeader::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyHeader::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyHeader::class, ['slotAttribute' => 'main-header']) + ->assertSee('slot="main-header"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyHeader::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyHeader::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyHeader::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyHeader::class, ['title' => 'main-header']) + ->assertSee('title="main-header"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyHeader::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/TestSupport/Components/Sections/MyHeader.php b/tests/TestSupport/Components/Sections/MyHeader.php new file mode 100644 index 00000000..b085d648 --- /dev/null +++ b/tests/TestSupport/Components/Sections/MyHeader.php @@ -0,0 +1,9 @@ + Date: Fri, 5 Apr 2024 12:19:49 -0500 Subject: [PATCH 04/10] lwb-14 Implement h1 sections component --- resources/views/sections/h1.blade.php | 3 + src/Components/Sections/H1.php | 41 ++++++ tests/Feature/Sections/H1Test.php | 119 ++++++++++++++++++ .../TestSupport/Components/Sections/MyH1.php | 9 ++ 4 files changed, 172 insertions(+) create mode 100644 resources/views/sections/h1.blade.php create mode 100644 src/Components/Sections/H1.php create mode 100644 tests/Feature/Sections/H1Test.php create mode 100644 tests/TestSupport/Components/Sections/MyH1.php diff --git a/resources/views/sections/h1.blade.php b/resources/views/sections/h1.blade.php new file mode 100644 index 00000000..a5bcd7ad --- /dev/null +++ b/resources/views/sections/h1.blade.php @@ -0,0 +1,3 @@ +

+ {{ $slot }} +

diff --git a/src/Components/Sections/H1.php b/src/Components/Sections/H1.php new file mode 100644 index 00000000..6b1c96f7 --- /dev/null +++ b/src/Components/Sections/H1.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.h1', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/tests/Feature/Sections/H1Test.php b/tests/Feature/Sections/H1Test.php new file mode 100644 index 00000000..a464dd27 --- /dev/null +++ b/tests/Feature/Sections/H1Test.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyH1::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyH1::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyH1::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyH1::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyH1::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyH1::class, ['data' => ['name' => 'main-h1']]) + ->assertSee('data-name="main-h1"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyH1::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyH1::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyH1::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyH1::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyH1::class, ['id' => 'main-h1']) + ->assertSee('id="main-h1"', false); +}); + +it('can render with language', function () { + Livewire::test(MyH1::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyH1::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyH1::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyH1::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyH1::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyH1::class, ['slotAttribute' => 'main-h1']) + ->assertSee('slot="main-h1"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyH1::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyH1::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyH1::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyH1::class, ['title' => 'main-h1']) + ->assertSee('title="main-h1"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyH1::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/TestSupport/Components/Sections/MyH1.php b/tests/TestSupport/Components/Sections/MyH1.php new file mode 100644 index 00000000..9afae067 --- /dev/null +++ b/tests/TestSupport/Components/Sections/MyH1.php @@ -0,0 +1,9 @@ + Date: Fri, 5 Apr 2024 12:19:55 -0500 Subject: [PATCH 05/10] lwb-15 Implement h2 sections component --- resources/views/sections/h2.blade.php | 3 + src/Components/Sections/H2.php | 41 ++++++ tests/Feature/Sections/H2Test.php | 119 ++++++++++++++++++ .../TestSupport/Components/Sections/MyH2.php | 9 ++ 4 files changed, 172 insertions(+) create mode 100644 resources/views/sections/h2.blade.php create mode 100644 src/Components/Sections/H2.php create mode 100644 tests/Feature/Sections/H2Test.php create mode 100644 tests/TestSupport/Components/Sections/MyH2.php diff --git a/resources/views/sections/h2.blade.php b/resources/views/sections/h2.blade.php new file mode 100644 index 00000000..b320f32c --- /dev/null +++ b/resources/views/sections/h2.blade.php @@ -0,0 +1,3 @@ +

+ {{ $slot }} +

diff --git a/src/Components/Sections/H2.php b/src/Components/Sections/H2.php new file mode 100644 index 00000000..7a7a506b --- /dev/null +++ b/src/Components/Sections/H2.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.h2', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/tests/Feature/Sections/H2Test.php b/tests/Feature/Sections/H2Test.php new file mode 100644 index 00000000..6ea82364 --- /dev/null +++ b/tests/Feature/Sections/H2Test.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyH2::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyH2::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyH2::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyH2::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyH2::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyH2::class, ['data' => ['name' => 'main-h2']]) + ->assertSee('data-name="main-h2"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyH2::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyH2::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyH2::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyH2::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyH2::class, ['id' => 'main-h2']) + ->assertSee('id="main-h2"', false); +}); + +it('can render with language', function () { + Livewire::test(MyH2::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyH2::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyH2::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyH2::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyH2::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyH2::class, ['slotAttribute' => 'main-h2']) + ->assertSee('slot="main-h2"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyH2::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyH2::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyH2::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyH2::class, ['title' => 'main-h2']) + ->assertSee('title="main-h2"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyH2::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/TestSupport/Components/Sections/MyH2.php b/tests/TestSupport/Components/Sections/MyH2.php new file mode 100644 index 00000000..232173f3 --- /dev/null +++ b/tests/TestSupport/Components/Sections/MyH2.php @@ -0,0 +1,9 @@ + Date: Fri, 5 Apr 2024 12:20:02 -0500 Subject: [PATCH 06/10] lwb-16 Implement h3 sections component --- resources/views/sections/h3.blade.php | 3 + src/Components/Sections/H3.php | 41 ++++++ tests/Feature/Sections/H3Test.php | 119 ++++++++++++++++++ .../TestSupport/Components/Sections/MyH3.php | 9 ++ 4 files changed, 172 insertions(+) create mode 100644 resources/views/sections/h3.blade.php create mode 100644 src/Components/Sections/H3.php create mode 100644 tests/Feature/Sections/H3Test.php create mode 100644 tests/TestSupport/Components/Sections/MyH3.php diff --git a/resources/views/sections/h3.blade.php b/resources/views/sections/h3.blade.php new file mode 100644 index 00000000..a8c286d2 --- /dev/null +++ b/resources/views/sections/h3.blade.php @@ -0,0 +1,3 @@ +

+ {{ $slot }} +

diff --git a/src/Components/Sections/H3.php b/src/Components/Sections/H3.php new file mode 100644 index 00000000..c5f9e619 --- /dev/null +++ b/src/Components/Sections/H3.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.h3', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/tests/Feature/Sections/H3Test.php b/tests/Feature/Sections/H3Test.php new file mode 100644 index 00000000..f9790b2f --- /dev/null +++ b/tests/Feature/Sections/H3Test.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyH3::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyH3::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyH3::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyH3::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyH3::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyH3::class, ['data' => ['name' => 'main-h3']]) + ->assertSee('data-name="main-h3"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyH3::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyH3::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyH3::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyH3::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyH3::class, ['id' => 'main-h3']) + ->assertSee('id="main-h3"', false); +}); + +it('can render with language', function () { + Livewire::test(MyH3::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyH3::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyH3::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyH3::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyH3::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyH3::class, ['slotAttribute' => 'main-h3']) + ->assertSee('slot="main-h3"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyH3::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyH3::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyH3::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyH3::class, ['title' => 'main-h3']) + ->assertSee('title="main-h3"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyH3::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/TestSupport/Components/Sections/MyH3.php b/tests/TestSupport/Components/Sections/MyH3.php new file mode 100644 index 00000000..7ebdf8a5 --- /dev/null +++ b/tests/TestSupport/Components/Sections/MyH3.php @@ -0,0 +1,9 @@ + Date: Fri, 5 Apr 2024 12:20:08 -0500 Subject: [PATCH 07/10] lwb-17 Implement h4 sections component --- resources/views/sections/h4.blade.php | 3 + src/Components/Sections/H4.php | 41 ++++++ tests/Feature/Sections/H4Test.php | 119 ++++++++++++++++++ .../TestSupport/Components/Sections/MyH4.php | 9 ++ 4 files changed, 172 insertions(+) create mode 100644 resources/views/sections/h4.blade.php create mode 100644 src/Components/Sections/H4.php create mode 100644 tests/Feature/Sections/H4Test.php create mode 100644 tests/TestSupport/Components/Sections/MyH4.php diff --git a/resources/views/sections/h4.blade.php b/resources/views/sections/h4.blade.php new file mode 100644 index 00000000..76030c01 --- /dev/null +++ b/resources/views/sections/h4.blade.php @@ -0,0 +1,3 @@ +

+ {{ $slot }} +

diff --git a/src/Components/Sections/H4.php b/src/Components/Sections/H4.php new file mode 100644 index 00000000..a9eeb2ff --- /dev/null +++ b/src/Components/Sections/H4.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.h4', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/tests/Feature/Sections/H4Test.php b/tests/Feature/Sections/H4Test.php new file mode 100644 index 00000000..8b4ce866 --- /dev/null +++ b/tests/Feature/Sections/H4Test.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyH4::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyH4::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyH4::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyH4::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyH4::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyH4::class, ['data' => ['name' => 'main-h4']]) + ->assertSee('data-name="main-h4"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyH4::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyH4::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyH4::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyH4::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyH4::class, ['id' => 'main-h4']) + ->assertSee('id="main-h4"', false); +}); + +it('can render with language', function () { + Livewire::test(MyH4::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyH4::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyH4::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyH4::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyH4::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyH4::class, ['slotAttribute' => 'main-h4']) + ->assertSee('slot="main-h4"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyH4::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyH4::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyH4::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyH4::class, ['title' => 'main-h4']) + ->assertSee('title="main-h4"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyH4::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/TestSupport/Components/Sections/MyH4.php b/tests/TestSupport/Components/Sections/MyH4.php new file mode 100644 index 00000000..523fe62f --- /dev/null +++ b/tests/TestSupport/Components/Sections/MyH4.php @@ -0,0 +1,9 @@ + Date: Fri, 5 Apr 2024 12:20:14 -0500 Subject: [PATCH 08/10] lwb-18 Implement h5 sections component --- resources/views/sections/h5.blade.php | 3 + src/Components/Sections/H5.php | 41 ++++++ tests/Feature/Sections/H5Test.php | 119 ++++++++++++++++++ .../TestSupport/Components/Sections/MyH5.php | 9 ++ 4 files changed, 172 insertions(+) create mode 100644 resources/views/sections/h5.blade.php create mode 100644 src/Components/Sections/H5.php create mode 100644 tests/Feature/Sections/H5Test.php create mode 100644 tests/TestSupport/Components/Sections/MyH5.php diff --git a/resources/views/sections/h5.blade.php b/resources/views/sections/h5.blade.php new file mode 100644 index 00000000..c678f634 --- /dev/null +++ b/resources/views/sections/h5.blade.php @@ -0,0 +1,3 @@ +
+ {{ $slot }} +
diff --git a/src/Components/Sections/H5.php b/src/Components/Sections/H5.php new file mode 100644 index 00000000..5c3e2faa --- /dev/null +++ b/src/Components/Sections/H5.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.h5', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/tests/Feature/Sections/H5Test.php b/tests/Feature/Sections/H5Test.php new file mode 100644 index 00000000..473a467f --- /dev/null +++ b/tests/Feature/Sections/H5Test.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyH5::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyH5::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyH5::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyH5::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyH5::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyH5::class, ['data' => ['name' => 'main-h5']]) + ->assertSee('data-name="main-h5"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyH5::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyH5::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyH5::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyH5::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyH5::class, ['id' => 'main-h5']) + ->assertSee('id="main-h5"', false); +}); + +it('can render with language', function () { + Livewire::test(MyH5::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyH5::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyH5::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyH5::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyH5::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyH5::class, ['slotAttribute' => 'main-h5']) + ->assertSee('slot="main-h5"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyH5::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyH5::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyH5::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyH5::class, ['title' => 'main-h5']) + ->assertSee('title="main-h5"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyH5::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/TestSupport/Components/Sections/MyH5.php b/tests/TestSupport/Components/Sections/MyH5.php new file mode 100644 index 00000000..df8d1c75 --- /dev/null +++ b/tests/TestSupport/Components/Sections/MyH5.php @@ -0,0 +1,9 @@ + Date: Fri, 5 Apr 2024 12:20:20 -0500 Subject: [PATCH 09/10] lwb-19 Implement h6 sections component --- resources/views/sections/h6.blade.php | 3 + src/Components/Sections/H6.php | 41 ++++++ tests/Feature/Sections/H6Test.php | 119 ++++++++++++++++++ .../TestSupport/Components/Sections/MyH6.php | 9 ++ 4 files changed, 172 insertions(+) create mode 100644 resources/views/sections/h6.blade.php create mode 100644 src/Components/Sections/H6.php create mode 100644 tests/Feature/Sections/H6Test.php create mode 100644 tests/TestSupport/Components/Sections/MyH6.php diff --git a/resources/views/sections/h6.blade.php b/resources/views/sections/h6.blade.php new file mode 100644 index 00000000..00034c83 --- /dev/null +++ b/resources/views/sections/h6.blade.php @@ -0,0 +1,3 @@ +
+ {{ $slot }} +
diff --git a/src/Components/Sections/H6.php b/src/Components/Sections/H6.php new file mode 100644 index 00000000..b0ca27b2 --- /dev/null +++ b/src/Components/Sections/H6.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.h6', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/tests/Feature/Sections/H6Test.php b/tests/Feature/Sections/H6Test.php new file mode 100644 index 00000000..3b7d9f66 --- /dev/null +++ b/tests/Feature/Sections/H6Test.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyH6::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyH6::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyH6::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyH6::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyH6::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyH6::class, ['data' => ['name' => 'main-h6']]) + ->assertSee('data-name="main-h6"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyH6::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyH6::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyH6::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyH6::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyH6::class, ['id' => 'main-h6']) + ->assertSee('id="main-h6"', false); +}); + +it('can render with language', function () { + Livewire::test(MyH6::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyH6::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyH6::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyH6::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyH6::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyH6::class, ['slotAttribute' => 'main-h6']) + ->assertSee('slot="main-h6"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyH6::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyH6::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyH6::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyH6::class, ['title' => 'main-h6']) + ->assertSee('title="main-h6"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyH6::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/TestSupport/Components/Sections/MyH6.php b/tests/TestSupport/Components/Sections/MyH6.php new file mode 100644 index 00000000..176ed9b2 --- /dev/null +++ b/tests/TestSupport/Components/Sections/MyH6.php @@ -0,0 +1,9 @@ + Date: Fri, 5 Apr 2024 12:20:26 -0500 Subject: [PATCH 10/10] lwb-20 Implement hgroup sections component --- resources/views/sections/hgroup.blade.php | 3 + src/Components/Sections/Hgroup.php | 41 ++++++ tests/Feature/Sections/HgroupTest.php | 119 ++++++++++++++++++ .../Components/Sections/MyHgroup.php | 9 ++ 4 files changed, 172 insertions(+) create mode 100644 resources/views/sections/hgroup.blade.php create mode 100644 src/Components/Sections/Hgroup.php create mode 100644 tests/Feature/Sections/HgroupTest.php create mode 100644 tests/TestSupport/Components/Sections/MyHgroup.php diff --git a/resources/views/sections/hgroup.blade.php b/resources/views/sections/hgroup.blade.php new file mode 100644 index 00000000..1a2220b4 --- /dev/null +++ b/resources/views/sections/hgroup.blade.php @@ -0,0 +1,3 @@ +
+ {{ $slot }} +
diff --git a/src/Components/Sections/Hgroup.php b/src/Components/Sections/Hgroup.php new file mode 100644 index 00000000..2e8019ca --- /dev/null +++ b/src/Components/Sections/Hgroup.php @@ -0,0 +1,41 @@ +setGlobalAttributes(); + } + + /** + * Standard render function + */ + public function render(): Application|ContractedApplication|ContractedView|Factory|View + { + return view( + 'lw-bits::sections.hgroup', + [ + 'globalAttributes' => $this->getGlobalAttributes(), + 'slot' => '', + ] + ); + } +} diff --git a/tests/Feature/Sections/HgroupTest.php b/tests/Feature/Sections/HgroupTest.php new file mode 100644 index 00000000..d32389ac --- /dev/null +++ b/tests/Feature/Sections/HgroupTest.php @@ -0,0 +1,119 @@ +assertStatus(200); +}); + +it('can render with accesskey', function () { + Livewire::test(MyHgroup::class, ['accessKey' => true]) + ->assertSee('accesskey'); +}); + +it('can render with autocapitalize', function () { + Livewire::test(MyHgroup::class, ['autoCapitalize' => true]) + ->assertSee('autocapitalize'); +}); + +it('can render with autofocus', function () { + Livewire::test(MyHgroup::class, ['autoFocus' => true]) + ->assertSee('autofocus'); +}); + +it('can render with contenteditable', function () { + Livewire::test(MyHgroup::class, ['contentEditable' => true]) + ->assertSee('contenteditable'); +}); + +it('can render with css classes', function () { + Livewire::test(MyHgroup::class, ['cssClasses' => ['class1', 'class2']]) + ->assertSee('class="class1 class2"', false); +}); + +it('can render with data-*', function () { + Livewire::test(MyHgroup::class, ['data' => ['name' => 'main-hgroup']]) + ->assertSee('data-name="main-hgroup"', false); +}); + +it('can render with dir', function () { + Livewire::test(MyHgroup::class, ['direction' => 'rtl']) + ->assertSee('dir="rtl"', false); +}); + +it('can render with draggable', function () { + Livewire::test(MyHgroup::class, ['draggable' => true]) + ->assertSee('draggable'); +}); + +it('can render with enterkeyhint', function () { + Livewire::test(MyHgroup::class, ['enterKeyHint' => 'enter']) + ->assertSee('enterkeyhint="enter"', false); +}); + +it('can render with hidden', function () { + Livewire::test(MyHgroup::class, ['hidden' => true]) + ->assertSee('hidden'); +}); + +it('can render with id', function () { + Livewire::test(MyHgroup::class, ['id' => 'main-hgroup']) + ->assertSee('id="main-hgroup"', false); +}); + +it('can render with language', function () { + Livewire::test(MyHgroup::class, ['language' => 'en']) + ->assertSee('lang="en"', false); +}); + +it('can render with nonce', function () { + Livewire::test(MyHgroup::class, ['nonce' => 'abc123']) + ->assertSee('nonce="abc123"', false); +}); + +it('can render with parts', function () { + Livewire::test(MyHgroup::class, ['parts' => ['part1', 'part2']]) + ->assertSee('part="part1 part2"', false); +}); + +it('can render with popOver', function () { + Livewire::test(MyHgroup::class, ['popOver' => true]) + ->assertSee('popover'); +}); + +it('can render with role', function () { + Livewire::test(MyHgroup::class, ['role' => 'main']) + ->assertSee('role="main"', false); +}); + +it('can render with slot', function () { + Livewire::test(MyHgroup::class, ['slotAttribute' => 'main-hgroup']) + ->assertSee('slot="main-hgroup"', false); +}); + +it('can render with spellcheck', function () { + Livewire::test(MyHgroup::class, ['spellCheck' => true]) + ->assertSee('spellcheck'); +}); + +it('can render with styles', function () { + Livewire::test(MyHgroup::class, ['styles' => ['color' => 'red', 'font-size' => '16px']]) + ->assertSee('style="color:red;font-size:16px"', false); +}); + +it('can render with tabindex', function () { + Livewire::test(MyHgroup::class, ['tabIndex' => 1]) + ->assertSee('tabindex="1"', false); +}); + +it('can render with title', function () { + Livewire::test(MyHgroup::class, ['title' => 'main-hgroup']) + ->assertSee('title="main-hgroup"', false); +}); + +it('can render with translate', function () { + Livewire::test(MyHgroup::class, ['translate' => true]) + ->assertSee('translate'); +}); diff --git a/tests/TestSupport/Components/Sections/MyHgroup.php b/tests/TestSupport/Components/Sections/MyHgroup.php new file mode 100644 index 00000000..bf8a1020 --- /dev/null +++ b/tests/TestSupport/Components/Sections/MyHgroup.php @@ -0,0 +1,9 @@ +