Skip to content

test(templates): render every template with satori - #137

Merged
anurag629 merged 1 commit into
codercops:devfrom
prakashNalla:test/satori-render-smoke
Oct 16, 2026
Merged

anurag629 merged 1 commit into
codercops:devfrom
prakashNalla:test/satori-render-smoke

Conversation

@prakashNalla

Copy link
Copy Markdown
Contributor

Description

Adds tests/templates/render.test.ts, which runs Satori at 1200x630 on every template from getAllTemplates(): once with its defaults, and once with every non-required text/textarea field set to ''. The 8 fonts are read from public/fonts with fs, so it doesn't go through og-engine.ts or font-loader.ts. Test names include the template id. Also updated the line in CONTRIBUTING.md that said the tests don't run Satori yet.

Closes #78

How I Tested This

  • npm run check (0 errors, 0 warnings) and npm run test (21 files / 470 tests pass) on Node v22.23.3
  • The new file is 220 tests (110 templates, 2 cases each) and takes about 1.5s.
  • Removed display: 'flex' from the outer multi-child div in blog/minimal-dark.ts (not committed): both blog-minimal-dark cases fail with Expected <div> to have explicit "display: flex" or "display: none" if it has more than one child node. Put it back and they pass.

AI Assistance

Claude helped me write the tests.

Type of Change

  • Tests
  • Documentation

Screenshots

N/A, tests and one line of docs.

Checklist

  • This PR targets dev
  • I was assigned the linked issue
  • npm run check passes
  • npm run test passes
  • For a bug fix: the new test fails without my change
  • Tested locally with npm run dev
  • Screenshots included for visual changes
  • New templates follow the Template Guidelines

@anurag629 anurag629 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @prakashNalla, nice one. I ran it on top of dev: all 220 renders take about a second, and taking display: 'flex' off the outer div in blog/minimal-dark.ts fails both of its cases with the Satori error, same as you said. npm run check and all 470 tests pass. Merging.

@anurag629 anurag629 added the hacktoberfest-accepted PR counts for Hacktoberfest label Oct 16, 2026
@anurag629
anurag629 merged commit b25a7b3 into codercops:dev Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest-accepted PR counts for Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a Satori render smoke test for every template

2 participants