-
Notifications
You must be signed in to change notification settings - Fork 290
[comp] Production Deploy #2517
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[comp] Production Deploy #2517
Changes from all commits
880a3c6
955d078
3376196
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,157 @@ | ||
| import { render } from '@react-email/render'; | ||
| import { describe, expect, it } from 'vitest'; | ||
| import { AllPolicyNotificationEmail } from './all-policy-notification'; | ||
| import { InviteEmail } from './invite'; | ||
| import { InvitePortalEmail } from './invite-portal'; | ||
| import { MagicLinkEmail } from './magic-link'; | ||
| import { WelcomeEmail } from './marketing/welcome'; | ||
| import { OTPVerificationEmail } from './otp'; | ||
| import { PolicyNotificationEmail } from './policy-notification'; | ||
| import { TaskReminderEmail } from './reminders/task-reminder'; | ||
| import { TaskStatusNotificationEmail } from './reminders/task-status-notification'; | ||
| import { WeeklyTaskDigestEmail } from './reminders/weekly-task-digest'; | ||
| import { TrainingCompletedEmail } from './training-completed'; | ||
| import { UnassignedItemsNotificationEmail } from './unassigned-items-notification'; | ||
|
|
||
| // Regression: PR #2501 removed <head> from every template, which broke | ||
| // @react-email/tailwind's media-query injection (md:* classes) and caused | ||
| // every email to render to an empty Suspense fallback in production. | ||
| // These tests fail if any template renders to that fallback or otherwise | ||
| // produces broken output, so the same mistake can't ship again. | ||
|
|
||
| const SUSPENSE_ERROR_MARKER = '<!--$!-->'; | ||
|
|
||
| const cases = [ | ||
| { | ||
| name: 'weekly-task-digest', | ||
| el: ( | ||
| <WeeklyTaskDigestEmail | ||
| email="user@example.com" | ||
| userName="User" | ||
| organizationName="Acme" | ||
| organizationId="org_123" | ||
| tasks={[{ id: 't1', title: 'Task one' }]} | ||
| /> | ||
| ), | ||
| }, | ||
| { | ||
| name: 'task-reminder', | ||
| el: ( | ||
| <TaskReminderEmail | ||
| email="user@example.com" | ||
| name="User" | ||
| dueDate="2026-04-20" | ||
| recordId="r1" | ||
| /> | ||
| ), | ||
| }, | ||
| { | ||
| name: 'task-status-notification', | ||
| el: ( | ||
| <TaskStatusNotificationEmail | ||
| email="user@example.com" | ||
| userName="User" | ||
| taskName="Task" | ||
| oldStatus="todo" | ||
| newStatus="done" | ||
| organizationName="Acme" | ||
| organizationId="org_123" | ||
| taskId="t1" | ||
| changedByName="Admin" | ||
| /> | ||
| ), | ||
| }, | ||
| { | ||
| name: 'invite-portal', | ||
| el: ( | ||
| <InvitePortalEmail | ||
| email="user@example.com" | ||
| inviteLink="https://app.trycomp.ai/invite" | ||
| organizationName="Acme" | ||
| /> | ||
| ), | ||
| }, | ||
| { | ||
| name: 'invite', | ||
| el: ( | ||
| <InviteEmail | ||
| email="user@example.com" | ||
| organizationName="Acme" | ||
| inviteLink="https://app.trycomp.ai/invite" | ||
| /> | ||
| ), | ||
| }, | ||
| { name: 'welcome', el: <WelcomeEmail name="User" /> }, | ||
| { | ||
| name: 'policy-notification', | ||
| el: ( | ||
| <PolicyNotificationEmail | ||
| email="user@example.com" | ||
| userName="User" | ||
| organizationName="Acme" | ||
| organizationId="org_123" | ||
| policyName="Acceptable Use" | ||
| policyId="p1" | ||
| isUpdate={false} | ||
| /> | ||
| ), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test passes wrong props to PolicyNotificationEmailMedium Severity The regression test for Additional Locations (1)Reviewed by Cursor Bugbot for commit 3376196. Configure here. |
||
| }, | ||
| { | ||
| name: 'magic-link', | ||
| el: ( | ||
| <MagicLinkEmail | ||
| email="user@example.com" | ||
| url="https://app.trycomp.ai/magic" | ||
| inviteCode="abc" | ||
| /> | ||
| ), | ||
| }, | ||
| { | ||
| name: 'all-policy-notification', | ||
| el: ( | ||
| <AllPolicyNotificationEmail | ||
| email="user@example.com" | ||
| userName="User" | ||
| organizationName="Acme" | ||
| organizationId="org_123" | ||
| isUpdate={false} | ||
| /> | ||
| ), | ||
| }, | ||
| { name: 'otp', el: <OTPVerificationEmail email="user@example.com" otp="123456" /> }, | ||
| { | ||
| name: 'training-completed', | ||
| el: ( | ||
| <TrainingCompletedEmail | ||
| email="user@example.com" | ||
| userName="User" | ||
| organizationName="Acme" | ||
| completedAt={new Date('2026-04-13')} | ||
| /> | ||
| ), | ||
| }, | ||
| { | ||
| name: 'unassigned-items-notification', | ||
| el: ( | ||
| <UnassignedItemsNotificationEmail | ||
| email="user@example.com" | ||
| userName="User" | ||
| organizationName="Acme" | ||
| organizationId="org_123" | ||
| removedMemberName="Former" | ||
| unassignedItems={[{ type: 'task', id: 't1', name: 'Task' }]} | ||
| /> | ||
| ), | ||
| }, | ||
| ]; | ||
|
|
||
| describe('email templates render to non-empty HTML', () => { | ||
| for (const { name, el } of cases) { | ||
| it(name, async () => { | ||
| const html = await render(el); | ||
| expect(html).not.toContain(SUSPENSE_ERROR_MARKER); | ||
| expect(html).toContain('<body'); | ||
| expect(html.length).toBeGreaterThan(2000); | ||
| }); | ||
| } | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import { defineConfig } from 'vitest/config'; | ||
|
|
||
| export default defineConfig({ | ||
| test: { | ||
| environment: 'node', | ||
| globals: true, | ||
| include: ['emails/**/*.test.{ts,tsx}', 'lib/**/*.test.{ts,tsx}'], | ||
| exclude: ['node_modules', 'dist'], | ||
| }, | ||
| }); |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test passes wrong props to TaskStatusNotificationEmail
Medium Severity
The regression test for
TaskStatusNotificationEmailpasses props (oldStatus,newStatus,organizationId,taskId,changedByName) that don't exist in the component'sPropsinterface. The actually required propstaskStatusandtaskUrlare never provided. Since vitest uses esbuild which strips types, this test silently runs withundefinedfor both, giving false confidence that the component renders correctly while not actually testing it with valid data.Additional Locations (1)
packages/email/emails/reminders/task-status-notification.tsx#L17-L25Reviewed by Cursor Bugbot for commit 3376196. Configure here.