Skip to content

Test coverage across the stack, plus landing page and footer fixes - #280

Open
afrinxnahar wants to merge 5 commits into
feat/reply-to-job-applicantsfrom
chore/test-coverage-and-ui-polish
Open

afrinxnahar wants to merge 5 commits into
feat/reply-to-job-applicantsfrom
chore/test-coverage-and-ui-polish

Conversation

@afrinxnahar

Copy link
Copy Markdown
Collaborator

Stacked on feat/reply-to-job-applicants, because the swagger endpoint list here includes admin/applications/{id}/reply, which only exists on that branch. Retarget to main once 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/validation was untested despite being what every feature bills against.

New specs focus on the branches that cost money or leak data:

  • subtitle: plan upload caps, object prefix ownership, and the real-size recheck that deletes an oversize upload the signed URL could not enforce
  • thumbnail: per-image credit math, so a balance covering one image cannot buy a batch
  • video-generation: the Pro/Business/Scale gate, per-mode image ranges, edit preconditions, cancel states
  • youtube: URL parsing, OAuth refresh and persistence
  • credits: rounding, floors and plan rates across the whole model

Plus the worker retry classifier and token manager, and the web free-tool session, attribution, funnel and SEO helpers.

Pricing tests live in apps/api rather than packages/validations because that package has no jest runner and apps/api already 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:

  • lemonsqueezy-webhook: raw body through the real signature check. Forged, wrong-length and tampered payloads are proven 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.

Landing page and footer

  • Removed the reviews marquee. It ran on invented creators with invented subscriber counts presented as real social proof. Component and data deleted with it, nothing else imported either, and no rating schema referenced it.
  • Added the YouTube channel to the footer socials.

Shared connection lost screen

@repo/ui/connection-lost plus a /connection-lost route. Self-contained by design: inline SVG and CSS animation rather than an image and motion/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

createMetadata in apps/web/lib/seo.ts ends with a ...overrides spread that replaces openGraph wholesale, so the merge above it never applies. app/pricing/layout.tsx passes only url, 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

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.
@vercel

vercel Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
creatorai-web Ready Ready Preview Sep 18, 2026 6:02pm UTC

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