Incentive (E1): VIP-Badge in der Navigation, solange ein Incentive nur fuer VIP sichtbar ist
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
b38c6ca8e0
commit
96d7a9565e
2 changed files with 20 additions and 0 deletions
|
|
@ -296,6 +296,11 @@
|
|||
<a href="{{ route('user_incentive_teaser', [$sidenavIncentive->slug]) }}"
|
||||
class="sidenav-link"><i class="text-secondary sidenav-icon ion ion-md-trophy"></i>
|
||||
<div>{{ $sidenavIncentives->count() > 1 ? ($sidenavIncentive->getLang('name') ?: $sidenavIncentive->name) : __('navigation.incentive') }}</div>
|
||||
@if ($sidenavIncentive->vip_only)
|
||||
<div class="pl-1 ml-auto">
|
||||
<div class="badge badge-secondary" title="{{ __('incentive.vip_only_help') }}">VIP</div>
|
||||
</div>
|
||||
@endif
|
||||
</a>
|
||||
</li>
|
||||
@endforeach
|
||||
|
|
|
|||
|
|
@ -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]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue