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 --}} + + + {{-- Text --}} + + + + Bifrost turns 1! + Get + 30% off + annual plans with code + + + + + {{-- Discount code --}} + + HAPPYBIRTHDAY + + + {{-- Arrow --}} + + + + diff --git a/resources/views/components/layout.blade.php b/resources/views/components/layout.blade.php index d93bce6a..59980833 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('2027-01-01T00:00:00Z')) + + @else + + @endif diff --git a/tests/Feature/BifrostBirthdayBannerTest.php b/tests/Feature/BifrostBirthdayBannerTest.php new file mode 100644 index 00000000..9efeb9f8 --- /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-12-31T23: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('2027-01-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..62babcb1 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 + * 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('2027-01-01T00:00:00Z')); + $this->get('/') ->assertOk() ->assertSee('Celebrate')