-
Notifications
You must be signed in to change notification settings - Fork 377
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1469 from firebase/next
Feb-15-2023 release
- Loading branch information
Showing
8 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,42 @@ describe("e2e testing", () => { | |
}); | ||
}, 8000); | ||
|
||
test("should successfully send an email with a basic template", async (): Promise<void> => { | ||
/** create basic template */ | ||
const template = await templatesCollection.add({ | ||
subject: "@{{username}} is now following you!", | ||
}); | ||
|
||
/** Add a record with the template and no message object */ | ||
const record = { | ||
to: "[email protected]", | ||
template: { | ||
name: template.id, | ||
data: { | ||
username: "ada", | ||
}, | ||
}, | ||
}; | ||
|
||
/** Add a new mail document */ | ||
const doc = await mailCollection.add(record); | ||
|
||
/** Check the email response */ | ||
return new Promise((resolve, reject) => { | ||
const unsubscribe = doc.onSnapshot((snapshot) => { | ||
const document = snapshot.data(); | ||
|
||
if (document.delivery && document.delivery.info) { | ||
expect(document.delivery.info.accepted[0]).toEqual(record.to); | ||
expect(document.delivery.info.response).toContain("250 Accepted"); | ||
|
||
unsubscribe(); | ||
resolve(); | ||
} | ||
}); | ||
}); | ||
}); | ||
|
||
afterAll(() => { | ||
server.close(); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters