diff --git a/resources/views/layouts/includes/layout-sidenav.blade.php b/resources/views/layouts/includes/layout-sidenav.blade.php index 0e4f9bd8..e5311713 100755 --- a/resources/views/layouts/includes/layout-sidenav.blade.php +++ b/resources/views/layouts/includes/layout-sidenav.blade.php @@ -296,6 +296,11 @@
{{ $sidenavIncentives->count() > 1 ? ($sidenavIncentive->getLang('name') ?: $sidenavIncentive->name) : __('navigation.incentive') }}
+ @if ($sidenavIncentive->vip_only) +
+
VIP
+
+ @endif
@endforeach diff --git a/tests/Feature/Incentive/IncentiveVipOnlyTest.php b/tests/Feature/Incentive/IncentiveVipOnlyTest.php index 807a5e42..186e6638 100644 --- a/tests/Feature/Incentive/IncentiveVipOnlyTest.php +++ b/tests/Feature/Incentive/IncentiveVipOnlyTest.php @@ -41,6 +41,7 @@ function vipTestUser(int $admin = 0): User 'account_id' => $account->id, 'payment_account' => now()->addYear(), 'wizard' => 100, + 'active' => 1, ]); } @@ -93,6 +94,20 @@ it('zeigt VIP-Konten Teaser und Rangliste eines VIP-Incentives', function () { $this->get(route('user_incentive_teaser', [$incentive->slug]))->assertOk(); }); +it('zeigt in der Navigation ein VIP-Badge am VIP-Incentive', function () { + $incentive = vipOnlyChallenge(); + $public = vipOnlyChallenge(['vip_only' => false, 'name' => 'Offenes Incentive']); + $this->actingAs(vipTestUser(admin: 1)); + + $html = $this->get(route('user_incentive_teaser', [$public->slug]))->assertOk()->getContent(); + + $vipEntry = substr($html, strpos($html, route('user_incentive_teaser', [$incentive->slug])), 600); + $publicEntry = substr($html, strpos($html, route('user_incentive_teaser', [$public->slug]).'"'), 600); + + expect($vipEntry)->toContain('badge badge-secondary') + ->and($publicEntry)->not->toContain('badge badge-secondary'); +}); + it('zeigt allen Beratern ein Incentive ohne VIP-Sperre', function () { $incentive = vipOnlyChallenge(['vip_only' => false]);