Skip to content

test: add unit tests for buildHtml and EmailTransport#67

Merged
weaponsforge merged 1 commit into
devfrom
feat/test-scripts
Apr 16, 2026
Merged

test: add unit tests for buildHtml and EmailTransport#67
weaponsforge merged 1 commit into
devfrom
feat/test-scripts

Conversation

@weaponsforge
Copy link
Copy Markdown
Owner

@weaponsforge weaponsforge commented Apr 16, 2026

Summary

  • Add build.test.ts — unit tests for buildHtml() covering paragraph content, WYSIWYG content, XSS script-tag stripping, and validation rejections (missing content, invalid sender, too many recipients)
  • Add transport.test.ts — unit tests for EmailTransport covering initial null transporter state, pre-init error on getTransportOptions, invalid email rejection, and successful transporter creation with valid credentials

Test plan

  • npm test passes with no failures
  • Coverage report includes the new test files
  • XSS stripping test confirms <script> tags are sanitized from WYSIWYG input
  • Transport tests work with or without real OAuth2 env vars (fallback dummy values used)

Type of Change

  • Other (please describe): new test cases

Checklist

  • I have read the CONTRIBUTING.md
  • My code follows the CODE STYLE of this project
  • I have added tests where applicable
  • I have tested my changes locally

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 16, 2026

Warning

Rate limit exceeded

@weaponsforge has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 40 minutes and 0 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 40 minutes and 0 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a0c92653-8b2d-404c-8b19-afcc769753d8

📥 Commits

Reviewing files that changed from the base of the PR and between 82f3018 and 8503f43.

📒 Files selected for processing (2)
  • app/src/__tests__/build.test.ts
  • app/src/__tests__/transport.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/test-scripts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@weaponsforge weaponsforge merged commit 1f44551 into dev Apr 16, 2026
4 checks passed
@weaponsforge weaponsforge deleted the feat/test-scripts branch April 16, 2026 10:15
@weaponsforge weaponsforge mentioned this pull request Apr 16, 2026
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