Add end-to-end tests covering the full feed-to-published-post pipeline #118
Labels
No labels
bug
devops
duplicate
enhancement
good first issue
layout
next major release
next minor release
question
research
testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lvl0/fedi-feed-router#118
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The existing suite (Unit + Feature, ~790 tests) passes green while user-facing flows are broken. Every layer is tested in isolation; nothing tests the layers working together, and nothing tests what the user actually sees.
This ticket adds end-to-end coverage so "tests pass" means "the flow works".
Evidence — three failures in a single session, all with a green suite
1. #108 — modals rendered as an opaque grey sheet.
12 Livewire tests passed. They assert rendered HTML, never CSS. A Tailwind v3 utility removed in v4 (
bg-opacity-75) emitted no CSS, so the backdrop covered the modal at full opacity. The page was unusable; the suite was green.2. #115 — Belga feed produced no articles.
The RSS feed had 404'd upstream.
ArticleFetcherswallowed the failure and returned an empty collection, the job reported success, andlast_fetched_atupdated. No test noticed, because no test asserts that a feed actually yields articles.3. #117 — published posts have no thumbnail.
extractThumbnail()returns an entity-encoded URL (&instead of&). Extraction "succeeds", the value is passed to Lemmy, and the post publishes — just without an image. No test covers the extracted value's shape, only that a value exists.The common thread: each unit works, the composition does not. All three were found by manual clicking, not by tests.
Current state
tests/Unitandtests/Featureonly — seephpunit.xmlcomposer.json/package.json)Proposed coverage
Tier 1 — pipeline integration tests (no browser)
Cheapest and highest value; catches #115 and #117 style failures. Runs in the existing PHPUnit setup with
Http::fakefor all external calls.RouteArticlerows created for each active routeRouteArticle→ publishing → correct payload reaches the Lemmy client, asserting the shape of every field, includingcustom_thumbnailbeing a valid URL with no HTML entitiesTier 2 — browser tests
Needed for #108-class failures, where markup renders but the page is unusable.
Tier 3 — asset/CSS smoke check
Cheap guard against the #108 class of bug without a full browser:
npm run buildoutput contains selectors for a known set of critical classes (modal backdrop, form inputs)Design questions
E2Etestsuite inphpunit.xml, run in CI and on demand locally, is probably right.Http::fakethroughout (project rule: tests must work offline). But that reintroduces the #115 blind spot — a faked API always returns the shape we expect. Consider a small, separately-run contract test suite that hits real endpoints and is allowed to fail loudly, kept out of the offline suite.Acceptance criteria
.claude/PLATFORM.md: what each tier covers and when to add to itRelated