mirror of https://github.com/moparisthebest/mail
Merge pull request #129 from whiteout-io/dev/firefox-webapp
Add web app manifest for firefox webapp
This commit is contained in:
commit
ba55dfc90b
|
@ -93,7 +93,7 @@ module.exports = function(grunt) {
|
||||||
tasks: ['copy:lib', 'manifest']
|
tasks: ['copy:lib', 'manifest']
|
||||||
},
|
},
|
||||||
app: {
|
app: {
|
||||||
files: ['src/*.js', 'src/**/*.html', 'src/**/*.json', 'src/img/**/*', 'src/font/**/*'],
|
files: ['src/*.js', 'src/**/*.html', 'src/**/*.json', 'src/manifest.*', 'src/img/**/*', 'src/font/**/*'],
|
||||||
tasks: ['copy:app', 'copy:ca', 'copy:tpl', 'copy:img', 'copy:font', 'manifest-dev', 'manifest']
|
tasks: ['copy:app', 'copy:ca', 'copy:tpl', 'copy:img', 'copy:font', 'manifest-dev', 'manifest']
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -179,7 +179,7 @@ module.exports = function(grunt) {
|
||||||
app: {
|
app: {
|
||||||
expand: true,
|
expand: true,
|
||||||
cwd: 'src/',
|
cwd: 'src/',
|
||||||
src: ['*.html', '*.js', '*.json'],
|
src: ['*.html', '*.js', '*.json', 'manifest.*'],
|
||||||
dest: 'dist/'
|
dest: 'dist/'
|
||||||
},
|
},
|
||||||
integration: {
|
integration: {
|
||||||
|
@ -220,7 +220,7 @@ module.exports = function(grunt) {
|
||||||
timestamp: true,
|
timestamp: true,
|
||||||
hash: true,
|
hash: true,
|
||||||
cache: ['socket.io/socket.io.js'],
|
cache: ['socket.io/socket.io.js'],
|
||||||
exclude: ['appcache.manifest'],
|
exclude: ['appcache.manifest', 'manifest.webapp'],
|
||||||
master: ['index.html']
|
master: ['index.html']
|
||||||
},
|
},
|
||||||
src: ['**/*.*'],
|
src: ['**/*.*'],
|
||||||
|
|
14
server.js
14
server.js
|
@ -71,7 +71,6 @@ app.disable('x-powered-by');
|
||||||
//
|
//
|
||||||
|
|
||||||
var port = process.env.PORT || 8585,
|
var port = process.env.PORT || 8585,
|
||||||
oneDay = 86400000,
|
|
||||||
development = process.argv[2] === '--dev';
|
development = process.argv[2] === '--dev';
|
||||||
|
|
||||||
// set HTTP headers
|
// set HTTP headers
|
||||||
|
@ -81,7 +80,14 @@ app.use(function(req, res, next) {
|
||||||
// CSP
|
// CSP
|
||||||
var iframe = development ? "http://" + req.hostname + ":" + port : "https://" + req.hostname; // allow iframe to load assets
|
var iframe = development ? "http://" + req.hostname + ":" + port : "https://" + req.hostname; // allow iframe to load assets
|
||||||
res.set('Content-Security-Policy', "default-src 'self' " + iframe + "; object-src 'none'; connect-src *; style-src 'self' 'unsafe-inline' " + iframe + "; img-src 'self' data:");
|
res.set('Content-Security-Policy', "default-src 'self' " + iframe + "; object-src 'none'; connect-src *; style-src 'self' 'unsafe-inline' " + iframe + "; img-src 'self' data:");
|
||||||
return next();
|
// set Cache-control Header (for AppCache)
|
||||||
|
res.set('Cache-control', 'public, max-age=0');
|
||||||
|
next();
|
||||||
|
});
|
||||||
|
|
||||||
|
app.use('/appcache.manifest', function(req, res, next) {
|
||||||
|
res.set('Cache-control', 'no-cache');
|
||||||
|
next();
|
||||||
});
|
});
|
||||||
|
|
||||||
// redirect all http traffic to https
|
// redirect all http traffic to https
|
||||||
|
@ -97,9 +103,7 @@ app.use(function(req, res, next) {
|
||||||
app.use(compression());
|
app.use(compression());
|
||||||
|
|
||||||
// server static files
|
// server static files
|
||||||
app.use(express.static(__dirname + '/dist', {
|
app.use(express.static(__dirname + '/dist'));
|
||||||
maxAge: oneDay
|
|
||||||
}));
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Socket.io proxy
|
// Socket.io proxy
|
||||||
|
|
|
@ -173,24 +173,7 @@ define(function(require) {
|
||||||
};
|
};
|
||||||
|
|
||||||
self.checkForUpdate = function() {
|
self.checkForUpdate = function() {
|
||||||
if (!window.chrome || !chrome.runtime || !chrome.runtime.onUpdateAvailable) {
|
self._updateHandler.checkForUpdate(self.onError);
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// check for update and restart
|
|
||||||
chrome.runtime.onUpdateAvailable.addListener(function(details) {
|
|
||||||
axe.debug("Updating to version " + details.version);
|
|
||||||
chrome.runtime.reload();
|
|
||||||
});
|
|
||||||
chrome.runtime.requestUpdateCheck(function(status) {
|
|
||||||
if (status === "update_found") {
|
|
||||||
axe.debug("Update pending...");
|
|
||||||
} else if (status === "no_update") {
|
|
||||||
axe.debug("No update found.");
|
|
||||||
} else if (status === "throttled") {
|
|
||||||
axe.debug("Checking updates too frequently.");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,3 +1,19 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
// Check if a new ApaCache is available on page load.
|
||||||
|
if (typeof window.applicationCache !== 'undefined') {
|
||||||
|
window.onload = function() {
|
||||||
|
window.applicationCache.onupdateready = function() {
|
||||||
|
if (window.applicationCache.status === window.applicationCache.UPDATEREADY) {
|
||||||
|
// Browser downloaded a new app cache
|
||||||
|
if (window.confirm('A new version of Whiteout Mail is available. Restart the app to update?')) {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// hey Angular, we're bootstrapping manually!
|
// hey Angular, we're bootstrapping manually!
|
||||||
window.name = 'NG_DEFER_BOOTSTRAP!';
|
window.name = 'NG_DEFER_BOOTSTRAP!';
|
||||||
|
|
||||||
|
@ -54,8 +70,6 @@ requirejs([
|
||||||
backButtonUtil,
|
backButtonUtil,
|
||||||
FastClick
|
FastClick
|
||||||
) {
|
) {
|
||||||
'use strict';
|
|
||||||
|
|
||||||
// reset window.name
|
// reset window.name
|
||||||
window.name = util.UUID();
|
window.name = util.UUID();
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ define(function(require) {
|
||||||
appCtrl._adminDao.createUser({
|
appCtrl._adminDao.createUser({
|
||||||
emailAddress: $scope.emailAddress,
|
emailAddress: $scope.emailAddress,
|
||||||
password: $scope.pass,
|
password: $scope.pass,
|
||||||
phone: $scope.phone,
|
phone: $scope.phone.replace(/\s+/g, ''), // remove spaces from the phone number
|
||||||
betaCode: $scope.betaCode.toUpperCase()
|
betaCode: $scope.betaCode.toUpperCase()
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
$scope.busy = false;
|
$scope.busy = false;
|
||||||
|
|
|
@ -4,8 +4,6 @@ define(function(require) {
|
||||||
var appController = require('js/app-controller');
|
var appController = require('js/app-controller');
|
||||||
|
|
||||||
var LoginCtrl = function($scope, $location) {
|
var LoginCtrl = function($scope, $location) {
|
||||||
// check for app update
|
|
||||||
appController.checkForUpdate();
|
|
||||||
|
|
||||||
// start main application controller
|
// start main application controller
|
||||||
appController.start({
|
appController.start({
|
||||||
|
@ -16,6 +14,9 @@ define(function(require) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check for app update
|
||||||
|
appController.checkForUpdate();
|
||||||
|
|
||||||
initializeUser();
|
initializeUser();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -92,8 +93,9 @@ define(function(require) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function goTo(location) {
|
function goTo(location) {
|
||||||
$location.path(location);
|
$scope.$apply(function() {
|
||||||
$scope.$apply();
|
$location.path(location);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,6 @@ define(function(require) {
|
||||||
_ = require('underscore'),
|
_ = require('underscore'),
|
||||||
appController = require('js/app-controller'),
|
appController = require('js/app-controller'),
|
||||||
axe = require('axe'),
|
axe = require('axe'),
|
||||||
aes = require('js/crypto/aes-gcm'),
|
|
||||||
util = require('js/crypto/util'),
|
util = require('js/crypto/util'),
|
||||||
str = require('js/app-config').string,
|
str = require('js/app-config').string,
|
||||||
pgp, emailDao, outbox, keychainDao, auth;
|
pgp, emailDao, outbox, keychainDao, auth;
|
||||||
|
@ -37,7 +36,6 @@ define(function(require) {
|
||||||
|
|
||||||
// fill fields depending on replyTo
|
// fill fields depending on replyTo
|
||||||
fillFields(replyTo, replyAll, forward);
|
fillFields(replyTo, replyAll, forward);
|
||||||
$scope.updatePreview();
|
|
||||||
|
|
||||||
$scope.verify($scope.to[0]);
|
$scope.verify($scope.to[0]);
|
||||||
},
|
},
|
||||||
|
@ -61,7 +59,6 @@ define(function(require) {
|
||||||
$scope.bcc = [];
|
$scope.bcc = [];
|
||||||
$scope.subject = '';
|
$scope.subject = '';
|
||||||
$scope.body = '';
|
$scope.body = '';
|
||||||
$scope.ciphertextPreview = '';
|
|
||||||
$scope.attachments = [];
|
$scope.attachments = [];
|
||||||
$scope.addressBookCache = undefined;
|
$scope.addressBookCache = undefined;
|
||||||
}
|
}
|
||||||
|
@ -321,21 +318,6 @@ define(function(require) {
|
||||||
// Editing email body
|
// Editing email body
|
||||||
//
|
//
|
||||||
|
|
||||||
// generate key,iv for encryption preview
|
|
||||||
var key = util.random(128),
|
|
||||||
iv = util.random(128);
|
|
||||||
|
|
||||||
$scope.updatePreview = function() {
|
|
||||||
if (!$scope.sendBtnSecure || !$scope.body.trim()) {
|
|
||||||
$scope.ciphertextPreview = undefined;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Although this does encrypt live using AES, this is just for show. The plaintext is encrypted seperately before sending the email.
|
|
||||||
$scope.ciphertextPreview = aes.encrypt($scope.body, key, iv);
|
|
||||||
};
|
|
||||||
$scope.$watch('sendBtnSecure', $scope.updatePreview);
|
|
||||||
|
|
||||||
$scope.sendToOutbox = function() {
|
$scope.sendToOutbox = function() {
|
||||||
var email;
|
var email;
|
||||||
|
|
||||||
|
@ -466,27 +448,6 @@ define(function(require) {
|
||||||
//
|
//
|
||||||
|
|
||||||
var ngModule = angular.module('write', []);
|
var ngModule = angular.module('write', []);
|
||||||
ngModule.directive('contenteditable', function() {
|
|
||||||
return {
|
|
||||||
require: 'ngModel',
|
|
||||||
link: function(scope, elm, attrs, ctrl) {
|
|
||||||
// view -> model
|
|
||||||
elm.on('keyup keydown', function() {
|
|
||||||
// set model
|
|
||||||
ctrl.$setViewValue(elm[0].innerText);
|
|
||||||
scope.$digest();
|
|
||||||
});
|
|
||||||
|
|
||||||
// model -> view
|
|
||||||
ctrl.$render = function() {
|
|
||||||
elm[0].innerText = ctrl.$viewValue;
|
|
||||||
};
|
|
||||||
|
|
||||||
// load init value from DOM
|
|
||||||
ctrl.$setViewValue(elm[0].innerText);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
ngModule.directive('focusMe', function($timeout, $parse) {
|
ngModule.directive('focusMe', function($timeout, $parse) {
|
||||||
return {
|
return {
|
||||||
|
@ -496,7 +457,12 @@ define(function(require) {
|
||||||
scope.$watch(model, function(value) {
|
scope.$watch(model, function(value) {
|
||||||
if (value === true) {
|
if (value === true) {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
element[0].focus();
|
var el = element[0];
|
||||||
|
el.focus();
|
||||||
|
if (typeof el.selectionStart !== 'undefined' && typeof el.selectionEnd !== 'undefined') {
|
||||||
|
el.selectionStart = 0;
|
||||||
|
el.selectionEnd = 0;
|
||||||
|
}
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -504,17 +470,6 @@ define(function(require) {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
ngModule.directive('focusChild', function() {
|
|
||||||
return {
|
|
||||||
//scope: true, // optionally create a child scope
|
|
||||||
link: function(scope, element) {
|
|
||||||
element.on('click', function() {
|
|
||||||
element[0].children[0].focus();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
ngModule.directive('focusInput', function($timeout, $parse) {
|
ngModule.directive('focusInput', function($timeout, $parse) {
|
||||||
return {
|
return {
|
||||||
//scope: true, // optionally create a child scope
|
//scope: true, // optionally create a child scope
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
define(function(require) {
|
define(function(require) {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
var cfg = require('js/app-config').config,
|
var axe = require('axe'),
|
||||||
|
cfg = require('js/app-config').config,
|
||||||
updateV1 = require('js/util/update/update-v1'),
|
updateV1 = require('js/util/update/update-v1'),
|
||||||
updateV2 = require('js/util/update/update-v2'),
|
updateV2 = require('js/util/update/update-v2'),
|
||||||
updateV3 = require('js/util/update/update-v3'),
|
updateV3 = require('js/util/update/update-v3'),
|
||||||
|
@ -92,5 +93,40 @@ define(function(require) {
|
||||||
executeNextUpdate();
|
executeNextUpdate();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check application version and update correspondingly
|
||||||
|
*/
|
||||||
|
UpdateHandler.prototype.checkForUpdate = function(dialog) {
|
||||||
|
// Chrome Packaged App
|
||||||
|
if (typeof window.chrome !== 'undefined' && chrome.runtime && chrome.runtime.onUpdateAvailable) {
|
||||||
|
// check for Chrome app update and restart
|
||||||
|
chrome.runtime.onUpdateAvailable.addListener(function(details) {
|
||||||
|
axe.debug('New Chrome App update... requesting reload.');
|
||||||
|
// Chrome downloaded a new app version
|
||||||
|
dialog({
|
||||||
|
title: 'Update available',
|
||||||
|
message: 'A new version ' + details.version + ' of the app is available. Restart the app to update?',
|
||||||
|
positiveBtnStr: 'Restart',
|
||||||
|
negativeBtnStr: 'Not now',
|
||||||
|
showNegativeBtn: true,
|
||||||
|
callback: function(agree) {
|
||||||
|
if (agree) {
|
||||||
|
chrome.runtime.reload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
chrome.runtime.requestUpdateCheck(function(status) {
|
||||||
|
if (status === "update_found") {
|
||||||
|
axe.debug("Update pending...");
|
||||||
|
} else if (status === "no_update") {
|
||||||
|
axe.debug("No update found.");
|
||||||
|
} else if (status === "throttled") {
|
||||||
|
axe.debug("Checking updates too frequently.");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return UpdateHandler;
|
return UpdateHandler;
|
||||||
});
|
});
|
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"name": "Whiteout Mail",
|
||||||
|
"description": "Simple and elegant email client with integrated end-to-end encryption. Keeping your emails safe has never been so easy.",
|
||||||
|
"version": "0.17.1.0",
|
||||||
|
"launch_path": "/index.html",
|
||||||
|
"icons": {
|
||||||
|
"128": "/img/icon-128.png"
|
||||||
|
},
|
||||||
|
"developer": {
|
||||||
|
"name": "Whiteout Networks GmbH",
|
||||||
|
"url": "https://whiteout.io"
|
||||||
|
},
|
||||||
|
"default_locale": "en",
|
||||||
|
"type": "privileged",
|
||||||
|
"permissions": {
|
||||||
|
"tcp-socket": {
|
||||||
|
"description": "Required to connect to mail servers via IMAP/SMTP"
|
||||||
|
},
|
||||||
|
"desktop-notification": {
|
||||||
|
"description": "Required to show notifications on incoming mails."
|
||||||
|
},
|
||||||
|
"storage": {
|
||||||
|
"description": "Required to store messages for offline use."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -35,6 +35,8 @@ textarea {
|
||||||
line-height: inherit;
|
line-height: inherit;
|
||||||
-webkit-font-smoothing: antialiased;
|
-webkit-font-smoothing: antialiased;
|
||||||
-moz-osx-font-smoothing: grayscale;
|
-moz-osx-font-smoothing: grayscale;
|
||||||
|
// disable box shadow on firefox
|
||||||
|
background-image: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldset {
|
fieldset {
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
.subject-box {
|
.subject-box {
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
position: relative;
|
position: relative;
|
||||||
margin: 20px 0 7px 0;
|
margin: 20px 0;
|
||||||
|
|
||||||
input[type=file] {
|
input[type=file] {
|
||||||
visibility: hidden;
|
visibility: hidden;
|
||||||
|
@ -146,33 +146,18 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.body {
|
textarea {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
width: 100%;
|
||||||
|
border: none;
|
||||||
|
outline: none;
|
||||||
|
color: $color-grey-dark;
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
user-select: text;
|
overflow-y: auto;
|
||||||
overflow-y: scroll;
|
|
||||||
// allow scrolling on iOS
|
// allow scrolling on iOS
|
||||||
-webkit-overflow-scrolling: touch;
|
-webkit-overflow-scrolling: touch;
|
||||||
// put layer on GPU
|
// put layer on GPU
|
||||||
transform: translatez(0);
|
transform: translatez(0);
|
||||||
|
|
||||||
*[contentEditable] {
|
|
||||||
outline: 0px;
|
|
||||||
cursor: text;
|
|
||||||
}
|
|
||||||
|
|
||||||
.encrypt-preview {
|
|
||||||
font-size: 0.9em;
|
|
||||||
margin-top: 3em;
|
|
||||||
font-family: monospace;
|
|
||||||
color: $color-grey-light;
|
|
||||||
word-wrap: break-word;
|
|
||||||
transition: opacity 0.5s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.invisible {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.send-control {
|
.send-control {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<input type="file" accept=".asc" file-reader tabindex="1">
|
<input type="file" accept=".asc" file-reader tabindex="1">
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<input class="input-text" type="password" ng-model="passphrase" ng-class="{'input-text-error':incorrect}" placeholder="Passphrase" tabindex="2" focus-me="true">
|
<input class="input-text" type="password" ng-model="passphrase" ng-class="{'input-text-error':incorrect}" placeholder="Passphrase" tabindex="2">
|
||||||
</div>
|
</div>
|
||||||
<a href="https://whiteout.io/revocation.html" title="Click here to reset your account." target="_blank">Lost your keyfile or passphrase?</a>
|
<a href="https://whiteout.io/revocation.html" title="Click here to reset your account." target="_blank">Lost your keyfile or passphrase?</a>
|
||||||
<div><button type="submit" wo-touch="confirmPassphrase()" class="btn" ng-disabled="!key" tabindex="3">Import</button>
|
<div><button type="submit" wo-touch="confirmPassphrase()" class="btn" ng-disabled="!key" tabindex="3">Import</button>
|
||||||
|
|
|
@ -58,13 +58,7 @@
|
||||||
</span><!--/.attachment-->
|
</span><!--/.attachment-->
|
||||||
</div><!--/.attachments-box-->
|
</div><!--/.attachments-box-->
|
||||||
|
|
||||||
<div class="body" focus-child>
|
<textarea ng-model="body" spellcheck="true" focus-me="state.lightbox === 'write' && writerTitle === 'Reply'" tabindex="3"></textarea>
|
||||||
<p ng-model="body" contentEditable="true" ng-change="updatePreview()" tabindex="3" focus-me="state.lightbox === 'write' && writerTitle === 'Reply'"></p>
|
|
||||||
|
|
||||||
<div class="encrypt-preview" ng-show="ciphertextPreview && sendBtnSecure">
|
|
||||||
<p>-----BEGIN ENCRYPTED PREVIEW-----<br>{{ciphertextPreview}}<br>-----END ENCRYPTED PREVIEW-----</p>
|
|
||||||
</div><!--/.encrypt-preview-->
|
|
||||||
</div><!--/.body-->
|
|
||||||
|
|
||||||
<div class="send-control">
|
<div class="send-control">
|
||||||
<button wo-touch="sendToOutbox()" class="btn" ng-class="{'btn-primary': sendBtnSecure === false}" ng-disabled="!okToSend" tabindex="4">{{sendBtnText || 'Send'}}</button>
|
<button wo-touch="sendToOutbox()" class="btn" ng-class="{'btn-primary': sendBtnSecure === false}" ng-disabled="!okToSend" tabindex="4">{{sendBtnText || 'Send'}}</button>
|
||||||
|
|
|
@ -60,6 +60,7 @@ define(function(require) {
|
||||||
it('should fail to error creating user', function(done) {
|
it('should fail to error creating user', function(done) {
|
||||||
scope.form.$invalid = false;
|
scope.form.$invalid = false;
|
||||||
scope.betaCode = 'asfd';
|
scope.betaCode = 'asfd';
|
||||||
|
scope.phone = '12345';
|
||||||
adminStub.createUser.yieldsAsync(new Error('asdf'));
|
adminStub.createUser.yieldsAsync(new Error('asdf'));
|
||||||
|
|
||||||
scope.$apply = function() {
|
scope.$apply = function() {
|
||||||
|
@ -76,6 +77,7 @@ define(function(require) {
|
||||||
it('should work', function(done) {
|
it('should work', function(done) {
|
||||||
scope.form.$invalid = false;
|
scope.form.$invalid = false;
|
||||||
scope.betaCode = 'asfd';
|
scope.betaCode = 'asfd';
|
||||||
|
scope.phone = '12345';
|
||||||
adminStub.createUser.yieldsAsync();
|
adminStub.createUser.yieldsAsync();
|
||||||
|
|
||||||
scope.$apply = function() {
|
scope.$apply = function() {
|
||||||
|
|
|
@ -64,7 +64,6 @@ define(function(require) {
|
||||||
expect(scope.state.writer.close).to.exist;
|
expect(scope.state.writer.close).to.exist;
|
||||||
expect(scope.verify).to.exist;
|
expect(scope.verify).to.exist;
|
||||||
expect(scope.checkSendStatus).to.exist;
|
expect(scope.checkSendStatus).to.exist;
|
||||||
expect(scope.updatePreview).to.exist;
|
|
||||||
expect(scope.sendToOutbox).to.exist;
|
expect(scope.sendToOutbox).to.exist;
|
||||||
expect(scope.tagStyle).to.exist;
|
expect(scope.tagStyle).to.exist;
|
||||||
expect(scope.lookupAddressBook).to.exist;
|
expect(scope.lookupAddressBook).to.exist;
|
||||||
|
@ -91,7 +90,6 @@ define(function(require) {
|
||||||
expect(scope.to).to.deep.equal([]);
|
expect(scope.to).to.deep.equal([]);
|
||||||
expect(scope.subject).to.equal('');
|
expect(scope.subject).to.equal('');
|
||||||
expect(scope.body).to.equal('');
|
expect(scope.body).to.equal('');
|
||||||
expect(scope.ciphertextPreview).to.equal(undefined);
|
|
||||||
expect(verifyMock.calledOnce).to.be.true;
|
expect(verifyMock.calledOnce).to.be.true;
|
||||||
|
|
||||||
scope.verify.restore();
|
scope.verify.restore();
|
||||||
|
@ -124,7 +122,6 @@ define(function(require) {
|
||||||
expect(scope.subject).to.equal('Re: ' + subject);
|
expect(scope.subject).to.equal('Re: ' + subject);
|
||||||
expect(scope.body).to.contain(body);
|
expect(scope.body).to.contain(body);
|
||||||
expect(scope.references).to.deep.equal(['ghi', 'def', 'abc']);
|
expect(scope.references).to.deep.equal(['ghi', 'def', 'abc']);
|
||||||
expect(scope.ciphertextPreview).to.not.be.empty;
|
|
||||||
expect(verifyMock.called).to.be.true;
|
expect(verifyMock.called).to.be.true;
|
||||||
|
|
||||||
scope.verify.restore();
|
scope.verify.restore();
|
||||||
|
@ -156,7 +153,6 @@ define(function(require) {
|
||||||
expect(scope.to).to.deep.equal([]);
|
expect(scope.to).to.deep.equal([]);
|
||||||
expect(scope.subject).to.equal('Fwd: ' + subject);
|
expect(scope.subject).to.equal('Fwd: ' + subject);
|
||||||
expect(scope.body).to.contain(body);
|
expect(scope.body).to.contain(body);
|
||||||
expect(scope.ciphertextPreview).to.be.undefined;
|
|
||||||
expect(verifyMock.called).to.be.true;
|
expect(verifyMock.called).to.be.true;
|
||||||
expect(scope.attachments).to.not.equal(re.attachments); // not the same reference
|
expect(scope.attachments).to.not.equal(re.attachments); // not the same reference
|
||||||
expect(scope.attachments).to.deep.equal(re.attachments); // but the same content
|
expect(scope.attachments).to.deep.equal(re.attachments); // but the same content
|
||||||
|
|
Loading…
Reference in New Issue