Skip to content

test(blog): assert scheduling behaviour, not one article's timestamp - #180

Merged
vreshch merged 1 commit into
masterfrom
fix/blog-test-schedule
Aug 11, 2026
Merged

test(blog): assert scheduling behaviour, not one article's timestamp#180
vreshch merged 1 commit into
masterfrom
fix/blog-test-schedule

Conversation

@vreshch

@vreshch vreshch commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Master CI went red on bfa2e68 because a scheduled post published. Two tests were pinned to one article's publishAt:

test why it broke
excludes a post scheduled for future publishAt expected everything-is-code to be missing from the listing. Its publishAt (2026-08-11T13:09Z) passed today, so the post correctly appeared
returns a scheduled post directly by slug asserted the literal 2026-08-10T08:00:00Z, so rescheduling the article broke CI

A 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.

  • The listing test checks the invariant across every post - nothing listed may still be hidden by the scheduler. Strictly stronger than naming one slug, and it cannot rot.
  • The lookup test checks that a direct slug lookup ignores scheduling, against 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 more honest check.

Verified locally with the exact CI sequence: type-check, lint, build, 30 tests, format:check.

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.
@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

🎉 PR Validation ✅ PASSED

Commit: 13201bca61794ec9a98b5c96db3fba7ed027e2cc
Branch: fix/blog-test-schedule

Checks:

  • ✅ Dependencies installed
  • ✅ Linting passed
  • ✅ Format check passed
  • ✅ Build successful
  • ✅ Docker build
  • ✅ E2E tests

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% changed

Ready to merge!


🔗 View workflow run
⏰ Generated at: 2026-08-11T21:17:51.765Z

@vreshch
vreshch merged commit 8d59e05 into master Aug 11, 2026
1 check passed
@vreshch
vreshch deleted the fix/blog-test-schedule branch August 11, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant