Skip to content

Commit

Permalink
Fixed missing bs in popover data attributes (#2667)
Browse files Browse the repository at this point in the history
* fix: missing `bs` in popover data attributes

* chore: added test

* Fixed code style

---------

Co-authored-by: drabodan <[email protected]>
  • Loading branch information
drabodan and drabodan authored Jul 29, 2023
1 parent 292738e commit e895d28
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
12 changes: 6 additions & 6 deletions resources/views/components/popover.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
role="button"
data-controller="popover"
data-action="click->popover#trigger"
data-container="body"
data-toggle="popover"
data-bs-container="body"
data-bs-toggle="popover"
tabindex="0"
data-trigger="focus"
data-placement="{{ $placement }}"
data-delay-show="300"
data-delay-hide="200"
data-bs-trigger="click"
data-bs-placement="{{ $placement }}"
data-bs-delay-show="300"
data-bs-delay-hide="200"
data-bs-content="{{ $content }}">
<x-orchid-icon path="bs.question-lg" width="1em" height="1em"/>
</sup>
18 changes: 18 additions & 0 deletions tests/Unit/Support/BladeComponentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,22 @@ public function testAnonymous(): void

$this->assertStringContainsString('Hello world', $view);
}

public function testPopoverComponent(): void
{
$view = Blade::renderComponent('orchid-popover', [
'content' => 'Hello world',
]);

$this->assertStringContainsString('data-bs-content="Hello world"', $view);
$this->assertStringContainsString('data-bs-placement="auto"', $view);

$view = Blade::renderComponent('orchid-popover', [
'content' => 'Hello world',
'placement' => 'right',
]);

$this->assertStringContainsString('data-bs-content="Hello world"', $view);
$this->assertStringContainsString('data-bs-placement="right"', $view);
}
}

0 comments on commit e895d28

Please sign in to comment.