From 59a583e34d435610d9eef2462c7fc6e6aaf11192 Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Tue, 24 Nov 2026 16:55:12 +0000 Subject: [PATCH] Swap the site banner to the Bifrost Black Friday offer The banner now advertises up to 50% off Bifrost annual plans and opens the Bifrost newsletter signup in a new tab, where the code is sent. It runs until 08:00 UTC on 1 December, then the 30% birthday banner comes back until the end of the year. Co-Authored-By: Claude Opus 5.5 --- .../components/black-friday-banner.blade.php | 72 +++++++------------ resources/views/components/layout.blade.php | 4 +- .../Feature/BifrostBlackFridayBannerTest.php | 55 ++++++++++++++ 3 files changed, 83 insertions(+), 48 deletions(-) create mode 100644 tests/Feature/BifrostBlackFridayBannerTest.php diff --git a/resources/views/components/black-friday-banner.blade.php b/resources/views/components/black-friday-banner.blade.php index 7f41cb1ae..d0908e7f7 100644 --- a/resources/views/components/black-friday-banner.blade.php +++ b/resources/views/components/black-friday-banner.blade.php @@ -1,19 +1,23 @@ - {{-- Label Section --}} + {{-- Label --}}
{{-- Icon --}} \ No newline at end of file + diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index 42dab2a66..ee8e92f9f 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -121,7 +121,9 @@ " class="min-h-screen overflow-x-clip bg-white font-poppins antialiased selection:bg-black selection:text-[#b4a9ff] dark:bg-[#050714] dark:text-white" > - @if (now()->isBefore('2027-01-01T00:00:00Z')) + @if (now()->isBefore('2026-12-01T08:00:00Z')) + + @elseif (now()->isBefore('2027-01-01T00:00:00Z')) @else diff --git a/tests/Feature/BifrostBlackFridayBannerTest.php b/tests/Feature/BifrostBlackFridayBannerTest.php new file mode 100644 index 000000000..e187ff350 --- /dev/null +++ b/tests/Feature/BifrostBlackFridayBannerTest.php @@ -0,0 +1,55 @@ +blade('') + ->assertSee('Black Friday:') + ->assertSee('50% off') + ->assertSee('href="https://bifrost.nativephp.com/newsletter"', escape: false) + ->assertSee('target="_blank"', escape: false) + ->assertSee('rel="noopener"', escape: false) + ->assertSee('bifrost_black_friday_banner_click', escape: false); + } + + #[Test] + public function the_banner_never_shows_a_discount_code(): void + { + $this->blade('') + ->assertDontSee('BLACKFRIDAY') + ->assertDontSee('HAPPYBIRTHDAY'); + } + + #[Test] + public function the_homepage_carries_the_black_friday_banner_until_the_sale_ends(): void + { + $this->travelTo(Carbon::parse('2026-12-01T07:59:59Z')); + + $this->get('/') + ->assertOk() + ->assertSee('bifrost_black_friday_banner_click', escape: false) + ->assertDontSee('bifrost_birthday_banner_click', escape: false); + } + + #[Test] + public function the_birthday_banner_comes_back_once_the_sale_ends(): void + { + $this->travelTo(Carbon::parse('2026-12-01T08:00:00Z')); + + $this->get('/') + ->assertOk() + ->assertDontSee('bifrost_black_friday_banner_click', escape: false) + ->assertSee('bifrost_birthday_banner_click', escape: false); + } +}