diff --git a/social/email/61-email.js b/social/email/61-email.js index 7d98ef75..fa4679d8 100644 --- a/social/email/61-email.js +++ b/social/email/61-email.js @@ -53,6 +53,8 @@ module.exports = function(RED) { if (globalkeys) { this.userid = globalkeys.user; flag = true; + } else { + this.error(RED._("email.errors.nouserid")); } } if(this.authtype === "BASIC" ) { diff --git a/test/social/email/61-email_spec.js b/test/social/email/61-email_spec.js index ab6f9845..fffc0a11 100644 --- a/test/social/email/61-email_spec.js +++ b/test/social/email/61-email_spec.js @@ -70,6 +70,7 @@ describe('email Node', function () { helper.load(emailNode, flow, function () { var n1 = helper.getNode("n1"); n1.should.have.property('name', "emailout"); + n1.should.have.property("authtype", "BASIC"); done(); }); }); @@ -102,7 +103,7 @@ describe('email Node', function () { //console.log(helper.log()); //logEvents.should.have.length(3); logEvents[0][0].should.have.a.property('msg'); - logEvents[0][0].msg.toString().should.startWith("email.errors.nopayload"); + logEvents[2][0].msg.toString().should.startWith("email.errors.nopayload"); done(); } catch (e) { done(e); @@ -153,7 +154,7 @@ describe('email Node', function () { // console.log(logEvents[0][0].msg.toString()); //logEvents.should.have.length(3); logEvents[0][0].should.have.a.property('msg'); - logEvents[0][0].msg.toString().should.startWith("Error:"); + logEvents[2][0].msg.toString().should.startWith("Error:"); done(); } catch (e) { done(e); @@ -198,7 +199,7 @@ describe('email Node', function () { //console.log(helper.log().args); //logEvents.should.have.length(3); logEvents[0][0].should.have.a.property('msg'); - logEvents[0][0].msg.toString().should.startWith("Error:"); + logEvents[2][0].msg.toString().should.startWith("Error:"); done(); } catch (e) { done(e);