From 9902013b6dc4d50bce69ffee2b2604b6e54e5a30 Mon Sep 17 00:00:00 2001 From: nelsonic Date: Sat, 2 May 2020 23:34:54 +0100 Subject: [PATCH] add test for verify email https://github.com/dwyl/auth/issues/62 --- templates/verify.html | 2 +- test/send.test.js | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/templates/verify.html b/templates/verify.html index b669a76..8963578 100644 --- a/templates/verify.html +++ b/templates/verify.html @@ -1,7 +1,7 @@

Hi!

Thank you for signing up with your - email address: {{email}}!

+ email address: {{email}}

Please click the link to verify your address: {{link}} diff --git a/test/send.test.js b/test/send.test.js index ce634a7..981f2cd 100644 --- a/test/send.test.js +++ b/test/send.test.js @@ -51,3 +51,22 @@ test('simulate bounce and complaint', function (t) { t.end(); }) }); + +test('simulate verification email', function (t) { + const event = { + "email": [ + "success@simulator.amazonses.com", + // "nelson@dwyl.com" + ], + "template": "verify", + "name": "Testy McTestface", + "id": 1, + "key": "simulate_verify", + "link": "https://dwyl.com/person/verify/StTqXEQ2l-Y" + }; // no template + send(event, function(err, data) { + console.log(data); + t.equal(data.MessageId.length, 60, "Sent! message_id: " + data.MessageId); + t.end(); + }) +});