Skip to content

Commit 394834f

Browse files
committed
Add TS test verifying subject is ""
1 parent 788958c commit 394834f

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: Email Test Document with No Subject Line
3+
author: Richard Iannone
4+
format: email
5+
---
6+
7+
The report content. Anything that is here is not part of the email message.
8+
9+
::: {.email}
10+
11+
::: {.email-text}
12+
An optional text-only version of the email message..
13+
:::
14+
15+
The HTML email content. Here you can add code cells, produce images, and write accompanying text.
16+
This content is not seen when viewing the rendered document on Connect (it's only
17+
seen when sending an email from the Connect document page). Emails from Connect
18+
can be sent manually, and they can also be scheduled.
19+
20+
:::
21+
22+
Any additional report content not part of the email message.

tests/smoke/render/render-email.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ testRender(docs("email/email.qmd"), "email", false, [fileExists(previewFile), va
3535
// Test basic attachment render, which will validate that attachment shows up in JSON
3636
testRender(docs("email/email-attach.qmd"), "email", false, [fileExists(previewFile), validJsonWithFields(jsonFile, {"rsc_email_subject": "The subject line.", "rsc_email_attachments": ["raw_data.csv"]})], cleanupCtx);
3737

38+
// Test an email render that has no subject line, this verifies that `rsc_email_subject` key is present and the value is an empty string
39+
testRender(docs("email/email-no-subject.qmd"), "email", false, [fileExists(previewFile), validJsonWithFields(jsonFile, {"rsc_email_subject": ""})], cleanupCtx);
40+
3841
// Render in a project with an output directory and confirm that everything ends up in the output directory
3942
testProjectRender(docs("email/project/email-attach.qmd"), "email", "_out", (outputDir: string) => {
4043
const verify: Verify[]= [];

0 commit comments

Comments
 (0)