Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#262 Fix Global Attributes Trait #263

Merged
merged 2 commits into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
223 changes: 130 additions & 93 deletions src/Components/GlobalAttributesTrait.php

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Components/Interactive/Dialog.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function mount(): void
if ($this->open) {
$this->specificAttributes->add(['open']);
}
if (! empty($this->tabIndex)) {
if (! empty($this->tabindex)) {
throw new InvalidAttributeException('A dialog element should not have a tabindex attribute');
}
}
Expand Down
20 changes: 10 additions & 10 deletions tests/Feature/Demarcation/DelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
});

it('can render with accesskey', function () {
Livewire::test(MyDel::class, ['accessKey' => true])
Livewire::test(MyDel::class, ['accesskey' => true])
->assertSee('accesskey');
});

it('can render with autocapitalize', function () {
Livewire::test(MyDel::class, ['autoCapitalize' => true])
Livewire::test(MyDel::class, ['autocapitalize' => true])
->assertSee('autocapitalize');
});

it('can render with autofocus', function () {
Livewire::test(MyDel::class, ['autoFocus' => true])
Livewire::test(MyDel::class, ['autofocus' => true])
->assertSee('autofocus');
});

it('can render with contenteditable', function () {
Livewire::test(MyDel::class, ['contentEditable' => true])
Livewire::test(MyDel::class, ['contenteditable' => true])
->assertSee('contenteditable');
});

Expand All @@ -44,12 +44,12 @@
});

it('can render with draggable', function () {
Livewire::test(MyDel::class, ['draggable' => true])
Livewire::test(MyDel::class, ['draggable' => 'true'])
->assertSee('draggable');
});

it('can render with enterkeyhint', function () {
Livewire::test(MyDel::class, ['enterKeyHint' => 'enter'])
Livewire::test(MyDel::class, ['enterkeyhint' => 'enter'])
->assertSee('enterkeyhint="enter"', false);
});

Expand Down Expand Up @@ -79,7 +79,7 @@
});

it('can render with popOver', function () {
Livewire::test(MyDel::class, ['popOver' => true])
Livewire::test(MyDel::class, ['popover' => true])
->assertSee('popover');
});

Expand All @@ -94,7 +94,7 @@
});

it('can render with spellcheck', function () {
Livewire::test(MyDel::class, ['spellCheck' => true])
Livewire::test(MyDel::class, ['spellcheck' => 'true'])
->assertSee('spellcheck');
});

Expand All @@ -104,7 +104,7 @@
});

it('can render with tabindex', function () {
Livewire::test(MyDel::class, ['tabIndex' => 1])
Livewire::test(MyDel::class, ['tabindex' => 1])
->assertSee('tabindex="1"', false);
});

Expand All @@ -114,6 +114,6 @@
});

it('can render with translate', function () {
Livewire::test(MyDel::class, ['translate' => true])
Livewire::test(MyDel::class, ['translate' => 'yes'])
->assertSee('translate');
});
20 changes: 10 additions & 10 deletions tests/Feature/Demarcation/InsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
});

it('can render with accesskey', function () {
Livewire::test(MyIns::class, ['accessKey' => true])
Livewire::test(MyIns::class, ['accesskey' => true])
->assertSee('accesskey');
});

it('can render with autocapitalize', function () {
Livewire::test(MyIns::class, ['autoCapitalize' => true])
Livewire::test(MyIns::class, ['autocapitalize' => true])
->assertSee('autocapitalize');
});

it('can render with autofocus', function () {
Livewire::test(MyIns::class, ['autoFocus' => true])
Livewire::test(MyIns::class, ['autofocus' => true])
->assertSee('autofocus');
});

it('can render with contenteditable', function () {
Livewire::test(MyIns::class, ['contentEditable' => true])
Livewire::test(MyIns::class, ['contenteditable' => true])
->assertSee('contenteditable');
});

Expand All @@ -44,12 +44,12 @@
});

it('can render with draggable', function () {
Livewire::test(MyIns::class, ['draggable' => true])
Livewire::test(MyIns::class, ['draggable' => 'true'])
->assertSee('draggable');
});

it('can render with enterkeyhint', function () {
Livewire::test(MyIns::class, ['enterKeyHint' => 'enter'])
Livewire::test(MyIns::class, ['enterkeyhint' => 'enter'])
->assertSee('enterkeyhint="enter"', false);
});

Expand Down Expand Up @@ -79,7 +79,7 @@
});

it('can render with popOver', function () {
Livewire::test(MyIns::class, ['popOver' => true])
Livewire::test(MyIns::class, ['popover' => true])
->assertSee('popover');
});

Expand All @@ -94,7 +94,7 @@
});

it('can render with spellcheck', function () {
Livewire::test(MyIns::class, ['spellCheck' => true])
Livewire::test(MyIns::class, ['spellcheck' => 'true'])
->assertSee('spellcheck');
});

Expand All @@ -104,7 +104,7 @@
});

it('can render with tabindex', function () {
Livewire::test(MyIns::class, ['tabIndex' => 1])
Livewire::test(MyIns::class, ['tabindex' => 1])
->assertSee('tabindex="1"', false);
});

Expand All @@ -114,6 +114,6 @@
});

it('can render with translate', function () {
Livewire::test(MyIns::class, ['translate' => true])
Livewire::test(MyIns::class, ['translate' => 'yes'])
->assertSee('translate');
});
20 changes: 10 additions & 10 deletions tests/Feature/DocumentMetadata/BaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
});

it('can render with accesskey', function () {
Livewire::test(MyBase::class, ['accessKey' => true])
Livewire::test(MyBase::class, ['accesskey' => true])
->assertSee('accesskey');
});

it('can render with autocapitalize', function () {
Livewire::test(MyBase::class, ['autoCapitalize' => true])
Livewire::test(MyBase::class, ['autocapitalize' => true])
->assertSee('autocapitalize');
});

it('can render with autofocus', function () {
Livewire::test(MyBase::class, ['autoFocus' => true])
Livewire::test(MyBase::class, ['autofocus' => true])
->assertSee('autofocus');
});

it('can render with contenteditable', function () {
Livewire::test(MyBase::class, ['contentEditable' => true])
Livewire::test(MyBase::class, ['contenteditable' => true])
->assertSee('contenteditable');
});

Expand All @@ -44,12 +44,12 @@
});

it('can render with draggable', function () {
Livewire::test(MyBase::class, ['draggable' => true])
Livewire::test(MyBase::class, ['draggable' => 'true'])
->assertSee('draggable');
});

it('can render with enterkeyhint', function () {
Livewire::test(MyBase::class, ['enterKeyHint' => 'enter'])
Livewire::test(MyBase::class, ['enterkeyhint' => 'enter'])
->assertSee('enterkeyhint="enter"', false);
});

Expand Down Expand Up @@ -79,7 +79,7 @@
});

it('can render with popOver', function () {
Livewire::test(MyBase::class, ['popOver' => true])
Livewire::test(MyBase::class, ['popover' => true])
->assertSee('popover');
});

Expand All @@ -94,7 +94,7 @@
});

it('can render with spellcheck', function () {
Livewire::test(MyBase::class, ['spellCheck' => true])
Livewire::test(MyBase::class, ['spellcheck' => 'true'])
->assertSee('spellcheck');
});

Expand All @@ -104,7 +104,7 @@
});

it('can render with tabindex', function () {
Livewire::test(MyBase::class, ['tabIndex' => 1])
Livewire::test(MyBase::class, ['tabindex' => 1])
->assertSee('tabindex="1"', false);
});

Expand All @@ -114,6 +114,6 @@
});

it('can render with translate', function () {
Livewire::test(MyBase::class, ['translate' => true])
Livewire::test(MyBase::class, ['translate' => 'yes'])
->assertSee('translate');
});
20 changes: 10 additions & 10 deletions tests/Feature/DocumentMetadata/HeadTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
});

it('can render with accesskey', function () {
Livewire::test(MyHead::class, ['accessKey' => true])
Livewire::test(MyHead::class, ['accesskey' => true])
->assertSee('accesskey');
});

it('can render with autocapitalize', function () {
Livewire::test(MyHead::class, ['autoCapitalize' => true])
Livewire::test(MyHead::class, ['autocapitalize' => true])
->assertSee('autocapitalize');
});

it('can render with autofocus', function () {
Livewire::test(MyHead::class, ['autoFocus' => true])
Livewire::test(MyHead::class, ['autofocus' => true])
->assertSee('autofocus');
});

it('can render with contenteditable', function () {
Livewire::test(MyHead::class, ['contentEditable' => true])
Livewire::test(MyHead::class, ['contenteditable' => true])
->assertSee('contenteditable');
});

Expand All @@ -44,12 +44,12 @@
});

it('can render with draggable', function () {
Livewire::test(MyHead::class, ['draggable' => true])
Livewire::test(MyHead::class, ['draggable' => 'true'])
->assertSee('draggable');
});

it('can render with enterkeyhint', function () {
Livewire::test(MyHead::class, ['enterKeyHint' => 'enter'])
Livewire::test(MyHead::class, ['enterkeyhint' => 'enter'])
->assertSee('enterkeyhint="enter"', false);
});

Expand Down Expand Up @@ -79,7 +79,7 @@
});

it('can render with popOver', function () {
Livewire::test(MyHead::class, ['popOver' => true])
Livewire::test(MyHead::class, ['popover' => true])
->assertSee('popover');
});

Expand All @@ -94,7 +94,7 @@
});

it('can render with spellcheck', function () {
Livewire::test(MyHead::class, ['spellCheck' => true])
Livewire::test(MyHead::class, ['spellcheck' => 'true'])
->assertSee('spellcheck');
});

Expand All @@ -104,7 +104,7 @@
});

it('can render with tabindex', function () {
Livewire::test(MyHead::class, ['tabIndex' => 1])
Livewire::test(MyHead::class, ['tabindex' => 1])
->assertSee('tabindex="1"', false);
});

Expand All @@ -114,6 +114,6 @@
});

it('can render with translate', function () {
Livewire::test(MyHead::class, ['translate' => true])
Livewire::test(MyHead::class, ['translate' => 'yes'])
->assertSee('translate');
});
20 changes: 10 additions & 10 deletions tests/Feature/DocumentMetadata/LinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@
});

it('can render with accesskey', function () {
Livewire::test(MyLink::class, ['accessKey' => true])
Livewire::test(MyLink::class, ['accesskey' => true])
->assertSee('accesskey');
});

it('can render with autocapitalize', function () {
Livewire::test(MyLink::class, ['autoCapitalize' => true])
Livewire::test(MyLink::class, ['autocapitalize' => true])
->assertSee('autocapitalize');
});

it('can render with autofocus', function () {
Livewire::test(MyLink::class, ['autoFocus' => true])
Livewire::test(MyLink::class, ['autofocus' => true])
->assertSee('autofocus');
});

it('can render with contenteditable', function () {
Livewire::test(MyLink::class, ['contentEditable' => true])
Livewire::test(MyLink::class, ['contenteditable' => true])
->assertSee('contenteditable');
});

Expand All @@ -44,12 +44,12 @@
});

it('can render with draggable', function () {
Livewire::test(MyLink::class, ['draggable' => true])
Livewire::test(MyLink::class, ['draggable' => 'true'])
->assertSee('draggable');
});

it('can render with enterkeyhint', function () {
Livewire::test(MyLink::class, ['enterKeyHint' => 'enter'])
Livewire::test(MyLink::class, ['enterkeyhint' => 'enter'])
->assertSee('enterkeyhint="enter"', false);
});

Expand Down Expand Up @@ -79,7 +79,7 @@
});

it('can render with popOver', function () {
Livewire::test(MyLink::class, ['popOver' => true])
Livewire::test(MyLink::class, ['popover' => true])
->assertSee('popover');
});

Expand All @@ -94,7 +94,7 @@
});

it('can render with spellcheck', function () {
Livewire::test(MyLink::class, ['spellCheck' => true])
Livewire::test(MyLink::class, ['spellcheck' => 'true'])
->assertSee('spellcheck');
});

Expand All @@ -104,7 +104,7 @@
});

it('can render with tabindex', function () {
Livewire::test(MyLink::class, ['tabIndex' => 1])
Livewire::test(MyLink::class, ['tabindex' => 1])
->assertSee('tabindex="1"', false);
});

Expand All @@ -114,6 +114,6 @@
});

it('can render with translate', function () {
Livewire::test(MyLink::class, ['translate' => true])
Livewire::test(MyLink::class, ['translate' => 'yes'])
->assertSee('translate');
});
Loading