test(blog): assert scheduling behaviour, not one article's timestamp - #180
Merged
Conversation
Master CI went red because a scheduled post published. Two tests were pinned to a single article's publishAt: - 'excludes a post scheduled for future publishAt' expected everything-is-code to be missing from the listing. Its publishAt passed today, so the post correctly appeared and the test failed. A scheduled article going live is the system working; it should never look like a broken build. - 'returns a scheduled post directly by slug' asserted the literal string '2026-08-10T08:00:00Z', so rescheduling the article broke CI - which says nothing about getPost, the function under test. Both now assert behaviour. The listing test checks the INVARIANT across every post (nothing listed may still be hidden by the scheduler), which is strictly stronger than naming one slug and cannot rot. The lookup test checks that a direct slug lookup ignores scheduling, using a fixed past date. publishAt is deliberately absent from the listing type, so the invariant reads it from the full post - which is also the honest check. Verified locally with the exact CI sequence: type-check, lint, build, 30 tests, format:check.
|
🎉 PR Validation ✅ PASSED Commit: Checks:
Visual Changes: 8 of 8 screenshots changed 📸 contacts desktop — 100% changed📸 contacts mobile — 100% changed📸 home desktop — 100% changed📸 home mobile — 100% changed📸 interests desktop — 100% changed📸 interests mobile — 100% changed📸 projects desktop — 100% changed📸 projects mobile — 100% changedReady to merge! ✨ 🔗 View workflow run |
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.
Master CI went red on
bfa2e68because a scheduled post published. Two tests were pinned to one article'spublishAt:excludes a post scheduled for future publishAteverything-is-codeto be missing from the listing. ItspublishAt(2026-08-11T13:09Z) passed today, so the post correctly appearedreturns a scheduled post directly by slug2026-08-10T08:00:00Z, so rescheduling the article broke CIA scheduled article going live is the system working. It should never look like a broken build, and neither assertion tested the function it named.
Fix
Both now assert behaviour instead of a timestamp.
publishAtis deliberately absent from the listing type, so the invariant reads it from the full post - which is also the more honest check.Verified locally with the exact CI sequence:
type-check,lint,build, 30 tests,format:check.