Add Cloudflare email and collaboration workflows
This commit is contained in:
@@ -7,12 +7,12 @@ import (
|
||||
|
||||
func TestRender_FileChanged(t *testing.T) {
|
||||
subject, body, err := Render("file_changed", TemplateData{
|
||||
ActorName: "Alice",
|
||||
DocumentPath: "docs/api.md",
|
||||
ActorName: "Alice",
|
||||
DocumentPath: "docs/api.md",
|
||||
DocumentTitle: "API Reference",
|
||||
ViewURL: "https://example.com/docs/api.md",
|
||||
UnsubURL: "https://example.com/unsub/123",
|
||||
InstanceName: "Cairnquire",
|
||||
ViewURL: "https://example.com/docs/api.md",
|
||||
UnsubURL: "https://example.com/unsub/123",
|
||||
InstanceName: "Cairnquire",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("Render: %v", err)
|
||||
@@ -39,10 +39,10 @@ func TestRender_FileChanged(t *testing.T) {
|
||||
|
||||
func TestRender_Comment(t *testing.T) {
|
||||
subject, body, err := Render("comment", TemplateData{
|
||||
ActorName: "Bob",
|
||||
ActorName: "Bob",
|
||||
DocumentTitle: "Getting Started",
|
||||
CommentBody: "This step is unclear.\nCan we add an example?",
|
||||
ViewURL: "https://example.com/docs/getting-started",
|
||||
CommentBody: "This step is unclear.\nCan we add an example?",
|
||||
ViewURL: "https://example.com/docs/getting-started",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("Render: %v", err)
|
||||
@@ -56,16 +56,16 @@ func TestRender_Comment(t *testing.T) {
|
||||
if !strings.Contains(body, "> Can we add an example?") {
|
||||
t.Errorf("body should quote second line: %q", body)
|
||||
}
|
||||
if !strings.Contains(body, "Reply to this email") {
|
||||
t.Errorf("body should mention reply-to-respond: %q", body)
|
||||
if !strings.Contains(body, "Open the document to reply") {
|
||||
t.Errorf("body should link users to the supported reply flow: %q", body)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRender_Mention(t *testing.T) {
|
||||
subject, body, err := Render("mention", TemplateData{
|
||||
ActorName: "Carol",
|
||||
ActorName: "Carol",
|
||||
DocumentTitle: "Spec",
|
||||
MentionText: "@dan please review",
|
||||
MentionText: "@dan please review",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("Render: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user