Fix date-dependent course tests and remove early bird course copy#398
Merged
Conversation
Pin the clock to before the 2026-06-15 price-increase deadline in the 'before deadline' course tests, and use a fixed published_at date for the masterclass seed so the product is reliably published under RefreshDatabase. Also remove the early bird waitlist copy from the course page. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5e12fdc to
95b4ae5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
published_at => now(), so underRefreshDatabasethe product's publish date was pinned to the moment the test suite ran rather than its real launch date. Any test time-travelling to before "now" then saw the product as unpublished. Changed it to the fixed launch date2026-03-07 00:00:00(matching production), makingProduct::isActive()deterministic when tests pin the clock.DashboardLayoutTest::test_dashboard_shows_masterclass_countdown_for_non_owner_before_deadlineandCoursePageTest::course_checkout_redirects_to_stripe_with_cart_success_urlrelied on the real clock being before the2026-06-15price-increase deadline. They now pin to2026-06-14 23:59:59(mirroring their "after deadline" siblings) and reset afterward./coursepage ("Grab the early bird price now and you'll be first in line when the doors open. Sign up below to stay in the loop.").Why
These tests were failing on/after the deadline date because they assumed the real clock was before the price-increase deadline and assumed the product was always published. The fixes make the tests independent of the wall clock.
Testing
php artisan test tests/Feature/CoursePageTest.php tests/Feature/DashboardLayoutTest.php→ 24 passed.🤖 Generated with Claude Code