diff --git a/resources/views/livewire/layout-popups.blade.php b/resources/views/livewire/layout-popups.blade.php index 2e5f6a02d..199774c3c 100644 --- a/resources/views/livewire/layout-popups.blade.php +++ b/resources/views/livewire/layout-popups.blade.php @@ -11,7 +11,7 @@ reminderCollapseAfter: 10000, isDevelopment: {{ isDev() ? 'true' : 'false' }}, init() { - this.popups.sponsorship = this.shouldShowMonthlyPopup('popupSponsorship'); + this.popups.sponsorship = !this.isDevelopment && this.shouldShowMonthlyPopup('popupSponsorship'); this.popups.notification = this.shouldShowMonthlyPopup('popupNotification'); this.popups.realtime = localStorage.getItem('popupRealtime'); @@ -86,7 +86,7 @@ return isDifferentMonth; {{-- } --}} } -}"> +}" @show-sponsorship-reminder.window="popups.sponsorship = true; reminders.sponsorship.compact = false"> @auth @if (!isCloud()) @@ -140,11 +140,12 @@ class="button h-9 justify-center bg-red-600! text-white! ring-1 ring-red-600/25 @endif @endauth - @if (instanceSettings()->is_sponsorship_popup_enabled && !isCloud()) + @if ((isDev() || instanceSettings()->is_sponsorship_popup_enabled) && ! isCloud()) false, 'label' => 'Enabled'], ['value' => true, 'label' => 'Disabled'], ]" /> - + + + @if (isDev()) + + Show sponsorship reminder + + @endif + diff --git a/tests/Feature/LayoutPopupsUiTest.php b/tests/Feature/LayoutPopupsUiTest.php index 167a23a04..374473281 100644 --- a/tests/Feature/LayoutPopupsUiTest.php +++ b/tests/Feature/LayoutPopupsUiTest.php @@ -36,3 +36,21 @@ ->toContain('reminders.sponsorship.compact = true') ->toContain('reminders.notification.compact = true'); }); + +test('sponsorship reminder is disabled in development', function () { + $view = file_get_contents(resource_path('views/livewire/layout-popups.blade.php')); + + expect($view) + ->toContain('this.popups.sponsorship = !this.isDevelopment && this.shouldShowMonthlyPopup') + ->toContain('@show-sponsorship-reminder.window="popups.sponsorship = true') + ->toContain('@show-sponsorship-reminder.window="bannerVisible = true"'); +}); + +test('advanced settings provides a development-only sponsorship reminder preview', function () { + $view = file_get_contents(resource_path('views/livewire/settings/advanced.blade.php')); + + expect($view) + ->toContain('@if (isDev())') + ->toContain("@click=\"\$dispatch('show-sponsorship-reminder')\"") + ->toContain('Show sponsorship reminder'); +});