From 652971e4458ef7c8ce0285c5077a58927c9b0f92 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Fri, 24 Jun 2016 18:14:53 -0500 Subject: [PATCH] run alias tests after restore --- test/cloudron-backup-test.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test/cloudron-backup-test.js b/test/cloudron-backup-test.js index 1fcb7cf..096d765 100644 --- a/test/cloudron-backup-test.js +++ b/test/cloudron-backup-test.js @@ -96,6 +96,7 @@ describe('Cloudron backup testing', function () { cloudron.saveSieveScript(owner, done); }); + // alias tests it('can send email to alias', function (done) { mailer.sendMailToCloudronUser('admin@' + box.domain, done); }); @@ -164,13 +165,35 @@ describe('Cloudron backup testing', function () { // mail tests as normal user it('retains old mail', function (done) { - cloudron.checkMail(owner, owner.username, done); + cloudron.checkMail(owner, done); }); it('can check sieve script', function (done) { cloudron.checkSieveScript(owner, done); }); + // alias tests continue to work after restore + it('can send email to alias', function (done) { + mailer.sendMailToCloudronUser('admin@' + box.domain, done); + }); + + it('did receive mail as alias (using owner name creds)', function (done) { + cloudron.checkMail(_.extend(owner, { to: 'admin' }), done); + }); + + it('can send mail as alias', function (done) { + cloudron.sendMail(_.extend(owner, { from: 'admin' }), 'test+' + cloudron.fqdn() + '@cloudron.io', done); + }); + + it('did send mail as cloudron alias', function (done) { + imap.probe({ + subject: common.regexp('Hi from e2e test - ' + cloudron.fqdn()), + from: common.regexp('admin@' + cloudron.fqdn()), + to: common.regexp('test+' + cloudron.fqdn() + '@cloudron.io'), + body: /This release depends on you/ + }, done); + }); + it('wait for app', function () { cloudron.waitForApp(appId); });