-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from ainesophaur/bugfix/blade-rendering-issue
Plugin issue with multiple panels
- Loading branch information
Showing
3 changed files
with
52 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
use DutchCodingCompany\FilamentDeveloperLogins\Tests\TestCase; | ||
use Filament\Facades\Filament; | ||
use Filament\Pages\Dashboard; | ||
use Filament\Panel; | ||
use Livewire\Livewire; | ||
|
||
final class MenuLoginsTest extends TestCase | ||
|
@@ -80,4 +81,19 @@ public function test_forbidden_is_returned_when_enabled_or_switchable_is_false() | |
->call('loginAs', '[email protected]') | ||
->assertForbidden(); | ||
} | ||
|
||
public function test_component_is_only_rendered_in_panel_with_plugin(): void | ||
{ | ||
$user = TestUser::factory()->create(); | ||
|
||
$this->actingAs($user) | ||
->get(Dashboard::getUrl(panel: $this->panelName)) | ||
->assertSuccessful() | ||
->assertSeeLivewire(MenuLogins::class); | ||
|
||
$this->actingAs($user) | ||
->get(Dashboard::getUrl(panel: $this->panelName.'-other')) | ||
->assertSuccessful() | ||
->assertDontSeeLivewire(MenuLogins::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters