aaronontheweb avatar

Verify Email Snapshots

Email templates break in subtle ways that unit tests miss. This uses Verify to snapshot the full rendered HTML of your email templates, so when something changes, you get a visual diff instead of a cryptic assertion failure. Works with MJML or any email renderer. You write a test that renders a template with sample variables, and Verify captures the HTML as a baseline. Next time it runs, any difference fails the build until you review and accept it. The real win is catching regressions during code review when someone tweaks a layout or variable substitution. Pair it with a diff tool or just open the HTML in a browser to see what actually changed.

skills.sh installs
436
GitHub stars
1.3K
last updated
Aug 21, 2026

Install

$ npx -y skills add aaronontheweb/dotnet-skills --skill verify-email-snapshots --agent claude-code

Installs into .claude/skills of the current project.

Files

Snapshot Testing Email Templates with Verify

When to Use This Skill

Use this skill when:

  • Testing email template rendering for regressions
  • Validating MJML templates compile to expected HTML
  • Reviewing email changes in code review (diffs are visual)
  • Ensuring variable substitution works correctly

Related skills:

  • aspnetcore/mjml-email-templates - MJML template authoring
  • aspire/mailpit-integration - Test email delivery locally
  • testing/snapshot-testing - General Verify patterns

Why Snapshot Test Emails?

Email templates are:

  1. Visual - Small changes can break rendering across clients
  2. Hard to unit test - Output is complex HTML, not simple values
  3. Prone to regression - Template changes can have unintended effects

Snapshot testing captures the rendered HTML and fails when it changes unexpectedly.


Installation

dotnet add package Verify.Xunit  # or Verify.NUnit, Verify.MSTest

Basic Email Snapshot Test

[Fact]
public async Task UserSignupInvitation_RendersCorrectly()
{
    // Arrange
    var renderer = _services.GetRequiredService<IMjmlTemplateRenderer>();

Sponsors

Details

Repository
github.com/aaronontheweb/dotnet-skills
Categories
Frontend Development, Testing & QA, .NET & C#
First seen
Jun 3, 2026

More from aaronontheweb/dotnet-skills

All 34
1secondsky avatarbun-sveltekitsecondsky/claude-skillsUse when building or running SvelteKit apps on Bun, including SSR, adapters, and Bun-specific APIs436skills.sh installs
2auth0 avatarauth0-spa-jsauth0/agent-skillsUse when adding Auth0 login or token management to a Vanilla JS, Svelte, or framework-agnostic SPA. Integrates @auth0/auth0-spa-js — use when there is no framew434skills.sh installs
3dalestudy avatartypescriptdalestudy/skillsTypeScript 타입 정의 및 베스트 프랙티스 스킬. 다음 상황에서 사용: (1) TypeScript 파일(.ts, .tsx) 작성 또는 수정 시, (2) 타입 정의(interface, type) 작업 시, (3) tsconfig.json 설정 또는 컴파일러 옵션 조정 시, (4) 431skills.sh installs
4existential-birds avatardoclingexistential-birds/beagleDocling document parser for PDF, DOCX, PPTX, HTML, images, and 15+ formats. Use when parsing documents, extracting text, converting to Markdown/HTML/JSON, chunk431skills.sh installs
5hairyf avatartaurihairyf/skillsCross-platform app toolkit with Rust backend and WebView frontend. Use when building or maintaining Tauri apps, configuring IPC/security, or developing plugins.431skills.sh installs
6secondsky avatarultracitesecondsky/claude-skillsUltracite multi-provider linting/formatting (Biome, ESLint, Oxlint). Use for v6/v7 setup, provider selection, Git hooks, MCP integration, AI hooks, migrations, 426skills.sh installs