From 0acfcbb3696314dcca5b5e83a0b755830765174c Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Thu, 10 Sep 2026 12:07:07 +0100 Subject: [PATCH 1/2] Add a Bifrost birthday banner to the site Bifrost is a year old. Until October 1st the site banner advertises 30% off annual Bifrost plans with the code HAPPYBIRTHDAY, then the newsletter banner takes the slot back. Co-Authored-By: Claude Opus 5 (1M context) --- .../bifrost-birthday-banner.blade.php | 71 +++++++++++++++++++ resources/views/components/layout.blade.php | 6 +- tests/Feature/BifrostBirthdayBannerTest.php | 46 ++++++++++++ tests/Feature/NewsletterSignupTest.php | 8 +++ 4 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 resources/views/components/bifrost-birthday-banner.blade.php create mode 100644 tests/Feature/BifrostBirthdayBannerTest.php diff --git a/resources/views/components/bifrost-birthday-banner.blade.php b/resources/views/components/bifrost-birthday-banner.blade.php new file mode 100644 index 00000000..9088b9dc --- /dev/null +++ b/resources/views/components/bifrost-birthday-banner.blade.php @@ -0,0 +1,71 @@ + + {{-- Label --}} +
+ {{-- Icon --}} +
+ + {{-- Discount code --}} + + HAPPYBIRTHDAY + + + {{-- Arrow --}} +
+ +
+
diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index d93bce6a..f9886520 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -118,7 +118,11 @@ " 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('2026-10-01T00:00:00Z')) + + @else + + @endif diff --git a/tests/Feature/BifrostBirthdayBannerTest.php b/tests/Feature/BifrostBirthdayBannerTest.php new file mode 100644 index 00000000..df1ec2b7 --- /dev/null +++ b/tests/Feature/BifrostBirthdayBannerTest.php @@ -0,0 +1,46 @@ +blade('') + ->assertSee('Bifrost turns 1!') + ->assertSee('30% off') + ->assertSee('HAPPYBIRTHDAY') + ->assertSee('https://bifrost.nativephp.com/pricing?billing=yearly', escape: false) + ->assertSee('bifrost_birthday_banner_click', escape: false); + } + + #[Test] + public function the_homepage_carries_the_birthday_banner_instead_of_the_newsletter_offer_during_the_sale(): void + { + $this->travelTo(Carbon::parse('2026-09-30T23:59:59Z')); + + $this->get('/') + ->assertOk() + ->assertSee('HAPPYBIRTHDAY') + ->assertDontSee('newsletter_banner_click', escape: false); + } + + #[Test] + public function the_newsletter_offer_takes_the_banner_slot_back_once_the_sale_ends(): void + { + $this->travelTo(Carbon::parse('2026-10-01T00:00:00Z')); + + $this->get('/') + ->assertOk() + ->assertDontSee('HAPPYBIRTHDAY') + ->assertSee('newsletter_banner_click', escape: false); + } +} diff --git a/tests/Feature/NewsletterSignupTest.php b/tests/Feature/NewsletterSignupTest.php index 7a990bd4..4c5b30eb 100644 --- a/tests/Feature/NewsletterSignupTest.php +++ b/tests/Feature/NewsletterSignupTest.php @@ -3,6 +3,7 @@ namespace Tests\Feature; use Illuminate\Foundation\Testing\RefreshDatabase; +use Illuminate\Support\Carbon; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; @@ -10,9 +11,16 @@ class NewsletterSignupTest extends TestCase { use RefreshDatabase; + /** + * Bifrost's birthday sale borrows the site banner slot until the end of + * September 2026, so this checks the newsletter offer once the slot has + * been handed back. The swap is covered by BifrostBirthdayBannerTest. + */ #[Test] public function the_site_banner_offers_the_discount_and_opens_the_signup_modal() { + $this->travelTo(Carbon::parse('2026-10-01T00:00:00Z')); + $this->get('/') ->assertOk() ->assertSee('Celebrate') From 3b87641836cf1cb37c6241898638810565727d3f Mon Sep 17 00:00:00 2001 From: Simon Hamp Date: Thu, 10 Sep 2026 12:10:32 +0100 Subject: [PATCH 2/2] Run the Bifrost birthday banner until the end of 2026 Co-Authored-By: Claude Opus 5 (1M context) --- resources/views/components/layout.blade.php | 2 +- tests/Feature/BifrostBirthdayBannerTest.php | 4 ++-- tests/Feature/NewsletterSignupTest.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index f9886520..59980833 100644 --- a/resources/views/components/layout.blade.php +++ b/resources/views/components/layout.blade.php @@ -118,7 +118,7 @@ " 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('2026-10-01T00:00:00Z')) + @if (now()->isBefore('2027-01-01T00:00:00Z')) @else diff --git a/tests/Feature/BifrostBirthdayBannerTest.php b/tests/Feature/BifrostBirthdayBannerTest.php index df1ec2b7..9efeb9f8 100644 --- a/tests/Feature/BifrostBirthdayBannerTest.php +++ b/tests/Feature/BifrostBirthdayBannerTest.php @@ -25,7 +25,7 @@ public function the_banner_offers_the_birthday_discount_on_annual_bifrost_plans( #[Test] public function the_homepage_carries_the_birthday_banner_instead_of_the_newsletter_offer_during_the_sale(): void { - $this->travelTo(Carbon::parse('2026-09-30T23:59:59Z')); + $this->travelTo(Carbon::parse('2026-12-31T23:59:59Z')); $this->get('/') ->assertOk() @@ -36,7 +36,7 @@ public function the_homepage_carries_the_birthday_banner_instead_of_the_newslett #[Test] public function the_newsletter_offer_takes_the_banner_slot_back_once_the_sale_ends(): void { - $this->travelTo(Carbon::parse('2026-10-01T00:00:00Z')); + $this->travelTo(Carbon::parse('2027-01-01T00:00:00Z')); $this->get('/') ->assertOk() diff --git a/tests/Feature/NewsletterSignupTest.php b/tests/Feature/NewsletterSignupTest.php index 4c5b30eb..62babcb1 100644 --- a/tests/Feature/NewsletterSignupTest.php +++ b/tests/Feature/NewsletterSignupTest.php @@ -13,13 +13,13 @@ class NewsletterSignupTest extends TestCase /** * Bifrost's birthday sale borrows the site banner slot until the end of - * September 2026, so this checks the newsletter offer once the slot has - * been handed back. The swap is covered by BifrostBirthdayBannerTest. + * 2026, so this checks the newsletter offer once the slot has been handed + * back. The swap is covered by BifrostBirthdayBannerTest. */ #[Test] public function the_site_banner_offers_the_discount_and_opens_the_signup_modal() { - $this->travelTo(Carbon::parse('2026-10-01T00:00:00Z')); + $this->travelTo(Carbon::parse('2027-01-01T00:00:00Z')); $this->get('/') ->assertOk()