Test coverage across the stack, plus landing page and footer fixes - #280
Open
afrinxnahar wants to merge 5 commits into
Open
afrinxnahar wants to merge 5 commits into
afrinxnahar wants to merge 5 commits into
Conversation
The API had no tests for subtitle, script, ideation, thumbnail, story-builder, video-generation, youtube or free-tools, and the pricing core in @repo/validation was untested despite being what every feature bills against. Adds unit specs for all of them, focused on the branches that cost money or leak data: plan upload caps and object ownership on subtitle, the per-image credit math on thumbnail, the plan gate and image ranges on video generation, OAuth refresh on youtube, and the rounding and floors across the whole credit model. Also covers the worker retry classifier and token manager, plus the web side free-tool session, attribution, funnel and SEO metadata helpers. The pricing tests live in apps/api rather than packages/validations because that package has no jest runner and apps/api already imports it. One test in seo.test.ts pins current buggy behaviour rather than correct behaviour, and says so: createMetadata replaces openGraph wholesale instead of merging, so the pricing page ships a social card with no title or description.
The swagger suite failed all 122 of its tests on a clean tree: it never got the dubbing or video-generation queue tokens after those controllers started injecting them, so the whole module failed to compile. Adds the missing providers, plus the four controllers the suite never covered (free-tools, hannah, video-generation, email-campaign). Its hand-maintained endpoint list had drifted 23 routes behind the code, so it is regenerated from the live spec at 163, and two renamed routes are corrected: dubbing status is keyed by job id, and the single subtitle upload is now the sign and finalize pair. Adds two integration suites that exercise real HTTP rather than calling controller methods: - lemonsqueezy-webhook: raw body through the real signature check, so forged, short and tampered payloads are proven to be rejected before any handler runs. This is the only unauthenticated write path that grants paid plans. - request-pipeline: auth guard, onboarding gate and zod pipe in order, including that an anonymous caller gets 401 rather than a validation error that would leak the schema.
The reviews marquee ran on LANDING_DUMMY_REVIEWS: made up creators with made up subscriber counts, presented as real social proof. Removes the section, the component and the data, since nothing else imported either. No nav anchor pointed at it and no aggregateRating or Review schema referenced it, so there is no orphaned markup claiming ratings we do not have. The surrounding sections keep their light and white alternation, so how-it-works hands straight off to why-creator-ai with no visual seam.
Places it second, after X, since a YouTube tool's own channel belongs near the front. Uses the existing socialLinks array and the Tabler icon set already imported there, so it inherits the dock layout and sizing on both desktop and the mobile collapsible.
A themed replacement for the generic "editor lost connection" screen, usable anywhere rather than rebuilt per surface. Lives in @repo/ui so both apps can reach it, with a /connection-lost route in web that renders it full screen. Deliberately self-contained: inline SVG instead of an image, and CSS animation instead of motion/react-m. The one situation this screen exists for is the one where fetching anything else is likely to fail, and the motion feature bundle arrives through a dynamic import that an offline browser cannot complete, which would leave the screen invisible. Reads live connectivity so it can tell the two cases apart: the browser being offline, versus a browser with a working network that still cannot reach the API. The second is worth saying, because it tells the user retrying is worthwhile and their wifi is not at fault. Also wires up @testing-library/jest-dom, which has been a dependency for a while but had no setup file, so component tests could render and then not assert on the result.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Stacked on
feat/reply-to-job-applicants, because the swagger endpoint list here includesadmin/applications/{id}/reply, which only exists on that branch. Retarget tomainonce it merges.Tests
The API had no coverage for subtitle, script, ideation, thumbnail, story-builder, video-generation, youtube or free-tools, and the pricing core in
@repo/validationwas untested despite being what every feature bills against.New specs focus on the branches that cost money or leak data:
Plus the worker retry classifier and token manager, and the web free-tool session, attribution, funnel and SEO helpers.
Pricing tests live in
apps/apirather thanpackages/validationsbecause that package has no jest runner andapps/apialready imports it.Swagger suite was broken
It failed all 122 of its tests on a clean tree, confirmed with
git stash: it never received the dubbing or video-generation queue tokens after those controllers started injecting them, so the module failed to compile.Repaired, and extended with the four controllers it never covered. Its endpoint list had drifted 23 routes behind the code, so it is regenerated at 163, with two renamed routes corrected.
Integration tests
Two suites over real HTTP rather than direct method calls:
Landing page and footer
Shared connection lost screen
@repo/ui/connection-lostplus a/connection-lostroute. Self-contained by design: inline SVG and CSS animation rather than an image andmotion/react-m, because the situation it exists for is the one where fetching anything else is likely to fail, and the motion feature bundle arrives via dynamic import that an offline browser cannot complete.It reads live connectivity to distinguish being offline from having a working network but an unreachable API.
Also wires up
@testing-library/jest-dom, a dependency that had no setup file, so component tests could render and then not assert on anything.Verification
716 tests passing: 393 API unit, 192 API e2e, 92 web, 39 workers. Type-check and lint clean. The connection lost screen was checked in the browser in light and dark, at desktop and mobile, with the offline state exercised.
Playwright was not run: the chromium binary is not installed in this environment.
Known defect, flagged not fixed
createMetadatainapps/web/lib/seo.tsends with a...overridesspread that replacesopenGraphwholesale, so the merge above it never applies.app/pricing/layout.tsxpasses onlyurl, so the pricing page ships a social card with no title, description or site name. A test pins the current behaviour and is labelled as pinning a defect rather than asserting correctness. Happy to fix in a follow-up.🤖 Generated with Claude Code