mirror of
https://github.com/moparisthebest/mail
synced 2025-02-17 23:40:22 -05:00
WIP add unit tests
This commit is contained in:
parent
c36cd069e0
commit
9bfda73969
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,3 +8,5 @@ dist/
|
||||
release/
|
||||
test/integration/src/
|
||||
.elasticbeanstalk/
|
||||
test/unit/index.js
|
||||
test/unit/index.js.map
|
||||
|
19
.jshintrc
19
.jshintrc
@ -18,19 +18,18 @@
|
||||
"unused": true,
|
||||
|
||||
"predef": [
|
||||
"console",
|
||||
"Notification",
|
||||
"importScripts",
|
||||
"process",
|
||||
"Event",
|
||||
"chrome",
|
||||
"define",
|
||||
"self",
|
||||
"describe",
|
||||
"it",
|
||||
"chai",
|
||||
"console",
|
||||
"process",
|
||||
"chrome",
|
||||
"Notification",
|
||||
"Event",
|
||||
"sinon",
|
||||
"mocha",
|
||||
"chai",
|
||||
"expect",
|
||||
"describe",
|
||||
"it",
|
||||
"before",
|
||||
"beforeEach",
|
||||
"after",
|
||||
|
45
Gruntfile.js
45
Gruntfile.js
@ -1,6 +1,8 @@
|
||||
module.exports = function(grunt) {
|
||||
'use strict';
|
||||
|
||||
require('time-grunt')(grunt);
|
||||
|
||||
var version = grunt.option('release'),
|
||||
zipName = (version) ? version : 'DEV';
|
||||
|
||||
@ -24,7 +26,7 @@ module.exports = function(grunt) {
|
||||
},
|
||||
|
||||
jshint: {
|
||||
all: ['Gruntfile.js', 'src/*.js', 'src/js/**/*.js', 'test/unit/*.js', 'test/integration/*.js'],
|
||||
all: ['Gruntfile.js', 'src/*.js', 'src/js/**/*.js', 'test/unit/*-test.js', 'test/integration/*.js'],
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
}
|
||||
@ -109,15 +111,21 @@ module.exports = function(grunt) {
|
||||
'dist/js/app.min.js': ['src/js/app.js']
|
||||
},
|
||||
options: {
|
||||
external: ['node-forge', 'net', 'tls'] // common.js apis not required at build time
|
||||
external: []
|
||||
}
|
||||
},
|
||||
/* TODO:
|
||||
tls-worker: {},
|
||||
unitTest: {
|
||||
files: {
|
||||
'test/unit/index.js': ['test/unit/*-test.js']
|
||||
},
|
||||
options: {
|
||||
external: []
|
||||
}
|
||||
},
|
||||
/*
|
||||
TODO:
|
||||
mailreader-worker: {},
|
||||
pbkdf2-worker: {},
|
||||
unitTest: {},
|
||||
unitTest: {},
|
||||
integrationTest: {}
|
||||
*/
|
||||
},
|
||||
@ -126,6 +134,7 @@ module.exports = function(grunt) {
|
||||
all: {
|
||||
files: {
|
||||
'dist/js/app.min.js': [
|
||||
'src/lib/openpgp/openpgp.js',
|
||||
'src/lib/underscore/underscore-min.js',
|
||||
'node_modules/jquery/dist/jquery.min.js',
|
||||
'src/lib/angular/angular.min.js',
|
||||
@ -142,6 +151,28 @@ module.exports = function(grunt) {
|
||||
]
|
||||
}
|
||||
},
|
||||
unitTest: {
|
||||
files: {
|
||||
'test/unit/index.js': [
|
||||
'src/lib/underscore/underscore-min.js',
|
||||
'node_modules/jquery/dist/jquery.min.js',
|
||||
'src/lib/openpgp/openpgp.js',
|
||||
'src/lib/angular/angular.min.js',
|
||||
'node_modules/angular-mocks/angular-mocks.js',
|
||||
'src/lib/angular/angular-route.min.js',
|
||||
'src/lib/angular/angular-animate.min.js',
|
||||
'src/lib/ngtagsinput/ng-tags-input.min.js',
|
||||
'src/lib/fastclick/fastclick.js',
|
||||
'node_modules/ng-infinite-scroll/build/ng-infinite-scroll.min.js',
|
||||
'src/lib/lawnchair/lawnchair-git.js',
|
||||
'src/lib/lawnchair/lawnchair-adapter-webkit-sqlite-git.js',
|
||||
'src/lib/lawnchair/lawnchair-adapter-indexed-db-git.js',
|
||||
'node_modules/dompurify/purify.js',
|
||||
'test/lib/angular-mocks.js',
|
||||
'test/unit/index.js'
|
||||
]
|
||||
}
|
||||
},
|
||||
options: {
|
||||
banner: '/*! Copyright © <%= grunt.template.today("yyyy") %>, Whiteout Networks GmbH.*/\n'
|
||||
}
|
||||
@ -152,7 +183,7 @@ module.exports = function(grunt) {
|
||||
expand: true,
|
||||
flatten: true,
|
||||
cwd: 'node_modules/',
|
||||
src: ['requirejs/require.js', 'mocha/mocha.css', 'mocha/mocha.js', 'chai/chai.js', 'sinon/pkg/sinon.js', 'angularjs/src/ngMock/angular-mocks.js', 'browsercrow/src/*.js', 'browsersmtp/src/*.js'],
|
||||
src: ['mocha/mocha.css', 'mocha/mocha.js', 'chai/chai.js', 'sinon/pkg/sinon.js', 'browsercrow/src/*.js', 'browsersmtp/src/*.js'],
|
||||
dest: 'test/lib/'
|
||||
},
|
||||
font: {
|
||||
|
@ -46,6 +46,7 @@
|
||||
"wo-smtpclient": "^0.3.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"angular-mocks": "^1.2.25",
|
||||
"angularjs": "https://github.com/whiteout-io/angular.js/tarball/npm-version",
|
||||
"browsercrow": "https://github.com/whiteout-io/browsercrow/tarball/master",
|
||||
"browsersmtp": "https://github.com/whiteout-io/browsersmtp/tarball/master",
|
||||
@ -65,6 +66,7 @@
|
||||
"grunt-manifest": "^0.4.0",
|
||||
"grunt-mocha": "~0.4.1",
|
||||
"mocha": "~1.13.0",
|
||||
"sinon": "~1.7.3"
|
||||
"sinon": "~1.7.3",
|
||||
"time-grunt": "^1.0.0"
|
||||
}
|
||||
}
|
@ -1,16 +1,13 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
AccountCtrl = require('js/controller/account'),
|
||||
PGP = require('js/crypto/pgp'),
|
||||
dl = require('js/util/download'),
|
||||
appController = require('js/app-controller'),
|
||||
KeychainDAO = require('js/dao/keychain-dao');
|
||||
var mocks = angular.mocks,
|
||||
AccountCtrl = require('../../src/js/controller/account'),
|
||||
PGP = require('../../src/js/crypto/pgp'),
|
||||
dl = require('../../src/js/util/download'),
|
||||
appController = require('../../src/js/app-controller'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao');
|
||||
|
||||
describe('Account Controller unit test', function() {
|
||||
describe('Account Controller unit test', function() {
|
||||
var scope, accountCtrl,
|
||||
dummyFingerprint, expectedFingerprint,
|
||||
dummyKeyId, expectedKeyId,
|
||||
@ -97,5 +94,4 @@ define(function(require) {
|
||||
scope.exportKeyFile();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,15 +1,12 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
AddAccountCtrl = require('js/controller/add-account'),
|
||||
Auth = require('js/bo/auth'),
|
||||
AdminDao = require('js/dao/admin-dao'),
|
||||
appController = require('js/app-controller');
|
||||
var mocks = angular.mocks,
|
||||
AddAccountCtrl = require('../../src/js/controller/add-account'),
|
||||
Auth = require('../../src/js/bo/auth'),
|
||||
AdminDao = require('../../src/js/dao/admin-dao'),
|
||||
appController = require('../../src/js/app-controller');
|
||||
|
||||
describe('Add Account Controller unit test', function() {
|
||||
describe('Add Account Controller unit test', function() {
|
||||
var scope, location, ctrl, authStub, origAuth, adminStub;
|
||||
|
||||
beforeEach(function() {
|
||||
@ -212,5 +209,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
@ -1,11 +1,9 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var RestDAO = require('js/dao/rest-dao'),
|
||||
AdminDAO = require('js/dao/admin-dao'),
|
||||
expect = chai.expect;
|
||||
var RestDAO = require('../../src/js/dao/rest-dao'),
|
||||
AdminDAO = require('../../src/js/dao/admin-dao');
|
||||
|
||||
describe('Admin DAO unit tests', function() {
|
||||
describe('Admin DAO unit tests', function() {
|
||||
|
||||
var adminDao, restDaoStub,
|
||||
emailAddress = 'test@example.com',
|
||||
@ -141,6 +139,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
@ -1,15 +1,13 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var controller = require('js/app-controller'),
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
OutboxBO = require('js/bo/outbox'),
|
||||
DeviceStorageDAO = require('js/dao/devicestorage-dao'),
|
||||
UpdateHandler = require('js/util/update/update-handler'),
|
||||
Auth = require('js/bo/auth'),
|
||||
expect = chai.expect;
|
||||
var controller = require('../../src/js/app-controller'),
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
OutboxBO = require('../../src/js/bo/outbox'),
|
||||
DeviceStorageDAO = require('../../src/js/dao/devicestorage-dao'),
|
||||
UpdateHandler = require('../../src/js/util/update/update-handler'),
|
||||
Auth = require('../../src/js/bo/auth');
|
||||
|
||||
describe('App Controller unit tests', function() {
|
||||
describe('App Controller unit tests', function() {
|
||||
var emailDaoStub, outboxStub, updateHandlerStub, appConfigStoreStub, devicestorageStub, isOnlineStub, authStub;
|
||||
|
||||
beforeEach(function() {
|
||||
@ -209,5 +207,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,13 +1,11 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var Auth = require('js/bo/auth'),
|
||||
OAuth = require('js/util/oauth'),
|
||||
PGP = require('js/crypto/pgp'),
|
||||
DeviceStorageDAO = require('js/dao/devicestorage-dao'),
|
||||
expect = chai.expect;
|
||||
var Auth = require('../../src/js/bo/auth'),
|
||||
OAuth = require('../../src/js/util/oauth'),
|
||||
PGP = require('../../src/js/crypto/pgp'),
|
||||
DeviceStorageDAO = require('../../src/js/dao/devicestorage-dao');
|
||||
|
||||
describe('Auth unit tests', function() {
|
||||
describe('Auth unit tests', function() {
|
||||
// Constancts
|
||||
var EMAIL_ADDR_DB_KEY = 'emailaddress';
|
||||
var USERNAME_DB_KEY = 'username';
|
||||
@ -374,5 +372,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,10 +1,8 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var btnHandler = require('js/util/backbutton-handler'),
|
||||
expect = chai.expect;
|
||||
var btnHandler = require('../../src/js/util/backbutton-handler');
|
||||
|
||||
describe('Backbutton Handler', function() {
|
||||
describe('Backbutton Handler', function() {
|
||||
chai.Assertion.includeStack = true;
|
||||
|
||||
var scope, event;
|
||||
@ -63,5 +61,4 @@ define(function(require) {
|
||||
navigator.app.exitApp = done;
|
||||
document.dispatchEvent(event);
|
||||
});
|
||||
});
|
||||
});
|
@ -1,14 +1,12 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var ConnectionDoctor = require('js/util/connection-doctor'),
|
||||
TCPSocket = require('tcp-socket'),
|
||||
var TCPSocket = require('tcp-socket'),
|
||||
ImapClient = require('imap-client'),
|
||||
SmtpClient = require('smtpclient'),
|
||||
cfg = require('js/app-config').config,
|
||||
expect = chai.expect;
|
||||
SmtpClient = require('wo-smtpclient'),
|
||||
ConnectionDoctor = require('../../src/js/util/connection-doctor'),
|
||||
cfg = require('../../src/js/app-config').config;
|
||||
|
||||
describe('Connection Doctor', function() {
|
||||
describe('Connection Doctor', function() {
|
||||
var doctor;
|
||||
var socketStub, imapStub, smtpStub, credentials;
|
||||
|
||||
@ -410,5 +408,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,15 +1,12 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
ContactsCtrl = require('js/controller/contacts'),
|
||||
appController = require('js/app-controller'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
PGP = require('js/crypto/pgp');
|
||||
var mocks = angular.mocks,
|
||||
ContactsCtrl = require('../../src/js/controller/contacts'),
|
||||
appController = require('../../src/js/app-controller'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao'),
|
||||
PGP = require('../../src/js/crypto/pgp');
|
||||
|
||||
describe('Contacts Controller unit test', function() {
|
||||
describe('Contacts Controller unit test', function() {
|
||||
var scope, contactsCtrl,
|
||||
origKeychain, keychainMock,
|
||||
origPgp, pgpMock;
|
||||
@ -186,5 +183,4 @@ define(function(require) {
|
||||
scope.removeKey(key);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,12 +1,10 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var Crypto = require('js/crypto/crypto'),
|
||||
util = require('js/crypto/util'),
|
||||
config = require('js/app-config').config,
|
||||
expect = chai.expect;
|
||||
var Crypto = require('../../src/js/crypto/crypto'),
|
||||
config = require('../../src/js/app-config').config,
|
||||
util = require('crypto-lib').util;
|
||||
|
||||
describe('Crypto unit tests', function() {
|
||||
describe('Crypto unit tests', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
var crypto,
|
||||
@ -54,5 +52,4 @@ define(function(require) {
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
});
|
@ -1,13 +1,11 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var LawnchairDAO = require('js/dao/lawnchair-dao'),
|
||||
DeviceStorageDAO = require('js/dao/devicestorage-dao'),
|
||||
expect = chai.expect;
|
||||
var LawnchairDAO = require('../../src/js/dao/lawnchair-dao'),
|
||||
DeviceStorageDAO = require('../../src/js/dao/devicestorage-dao');
|
||||
|
||||
var testUser = 'test@example.com';
|
||||
var testUser = 'test@example.com';
|
||||
|
||||
describe('Device Storage DAO unit tests', function() {
|
||||
describe('Device Storage DAO unit tests', function() {
|
||||
|
||||
var storageDao, lawnchairDaoStub;
|
||||
|
||||
@ -100,6 +98,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
@ -1,12 +1,9 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
DialogCtrl = require('js/controller/dialog');
|
||||
var mocks = angular.mocks,
|
||||
DialogCtrl = require('../../src/js/controller/dialog');
|
||||
|
||||
describe('Dialog Controller unit test', function() {
|
||||
describe('Dialog Controller unit test', function() {
|
||||
var scope, dialogCtrl;
|
||||
|
||||
beforeEach(function() {
|
||||
@ -46,5 +43,4 @@ define(function(require) {
|
||||
scope.confirm(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,19 +1,17 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var EmailDAO = require('js/dao/email-dao'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
var mailreader = require('mailreader'),
|
||||
ImapClient = require('imap-client'),
|
||||
PgpMailer = require('pgpmailer'),
|
||||
PgpBuilder = require('pgpbuilder'),
|
||||
PGP = require('js/crypto/pgp'),
|
||||
DeviceStorageDAO = require('js/dao/devicestorage-dao'),
|
||||
mailreader = require('mailreader'),
|
||||
cfg = require('js/app-config').config,
|
||||
expect = chai.expect;
|
||||
cfg = require('../../src/js/app-config').config,
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao'),
|
||||
PGP = require('../../src/js/crypto/pgp'),
|
||||
DeviceStorageDAO = require('../../src/js/dao/devicestorage-dao');
|
||||
|
||||
|
||||
describe('Email DAO unit tests', function() {
|
||||
describe('Email DAO unit tests', function() {
|
||||
// show the stack trace when an error occurred
|
||||
chai.Assertion.includeStack = true;
|
||||
|
||||
@ -2300,5 +2298,4 @@ define(function(require) {
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -9,11 +9,70 @@
|
||||
<body>
|
||||
<div id="mocha"></div>
|
||||
|
||||
<script>
|
||||
//
|
||||
// Polyfills
|
||||
//
|
||||
|
||||
(function() {
|
||||
'use strict';
|
||||
// Mozilla bind polyfill because phantomjs is stupid
|
||||
if (!Function.prototype.bind) {
|
||||
Function.prototype.bind = function(oThis) {
|
||||
if (typeof this !== "function") {
|
||||
// closest thing possible to the ECMAScript 5 internal IsCallable function
|
||||
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
||||
}
|
||||
|
||||
var aArgs = Array.prototype.slice.call(arguments, 1),
|
||||
fToBind = this,
|
||||
FNOP = function() {},
|
||||
fBound = function() {
|
||||
return fToBind.apply(this instanceof FNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
|
||||
};
|
||||
|
||||
FNOP.prototype = this.prototype;
|
||||
fBound.prototype = new FNOP();
|
||||
|
||||
return fBound;
|
||||
};
|
||||
}
|
||||
|
||||
// a warm round of applause for phantomjs for missing events
|
||||
(function() {
|
||||
function CustomEvent(event, params) {
|
||||
params = params || {
|
||||
bubbles: false,
|
||||
cancelable: false,
|
||||
detail: undefined
|
||||
};
|
||||
var evt = document.createEvent('CustomEvent');
|
||||
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
||||
return evt;
|
||||
}
|
||||
|
||||
CustomEvent.prototype = window.Event.prototype;
|
||||
|
||||
window.CustomEvent = CustomEvent;
|
||||
})();
|
||||
})();
|
||||
</script>
|
||||
|
||||
<script src="../lib/chai.js"></script>
|
||||
<script src="../lib/sinon.js"></script>
|
||||
<script src="../lib/mocha.js"></script>
|
||||
<script src="../lib/sinon.js"></script>
|
||||
|
||||
<script data-main="main.js" src="../../src/lib/require.js"></script>
|
||||
<script>
|
||||
window.expect = chai.expect;
|
||||
mocha.setup('bdd');
|
||||
</script>
|
||||
|
||||
<script src="index.js"></script>
|
||||
|
||||
<script>
|
||||
mocha.checkLeaks();
|
||||
mocha.globals([]);
|
||||
mocha.run();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,11 +1,9 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var RestDAO = require('js/dao/rest-dao'),
|
||||
InvitationDAO = require('js/dao/invitation-dao'),
|
||||
expect = chai.expect;
|
||||
var RestDAO = require('../../src/js/dao/rest-dao'),
|
||||
InvitationDAO = require('../../src/js/dao/invitation-dao');
|
||||
|
||||
describe('Invitation DAO unit tests', function() {
|
||||
describe('Invitation DAO unit tests', function() {
|
||||
var restDaoStub, invitationDao,
|
||||
alice = 'zuhause@aol.com',
|
||||
bob = 'manfred.mustermann@musterdomain.com',
|
||||
@ -104,5 +102,4 @@ define(function(require) {
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,17 +1,15 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var LawnchairDAO = require('js/dao/lawnchair-dao'),
|
||||
PublicKeyDAO = require('js/dao/publickey-dao'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
PrivateKeyDAO = require('js/dao/privatekey-dao'),
|
||||
Crypto = require('js/crypto/crypto'),
|
||||
PGP = require('js/crypto/pgp'),
|
||||
expect = chai.expect;
|
||||
var LawnchairDAO = require('../../src/js/dao/lawnchair-dao'),
|
||||
PublicKeyDAO = require('../../src/js/dao/publickey-dao'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao'),
|
||||
PrivateKeyDAO = require('../../src/js/dao/privatekey-dao'),
|
||||
Crypto = require('../../src/js/crypto/crypto'),
|
||||
PGP = require('../../src/js/crypto/pgp');
|
||||
|
||||
var testUser = 'test@example.com';
|
||||
var testUser = 'test@example.com';
|
||||
|
||||
describe('Keychain DAO unit tests', function() {
|
||||
describe('Keychain DAO unit tests', function() {
|
||||
|
||||
var keychainDao, lawnchairDaoStub, pubkeyDaoStub, privkeyDaoStub, cryptoStub, pgpStub;
|
||||
|
||||
@ -1381,6 +1379,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
@ -1,25 +1,23 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var LawnchairDAO = require('js/dao/lawnchair-dao'),
|
||||
expect = chai.expect;
|
||||
var LawnchairDAO = require('../../src/js/dao/lawnchair-dao');
|
||||
|
||||
|
||||
var dbName = 'lawnchair@test.com';
|
||||
var dbName = 'lawnchair@test.com';
|
||||
|
||||
var key = 'type_1';
|
||||
var data = {
|
||||
var key = 'type_1';
|
||||
var data = {
|
||||
name: 'testName1',
|
||||
type: 'testType1'
|
||||
};
|
||||
};
|
||||
|
||||
var key2 = 'type_2';
|
||||
var data2 = {
|
||||
var key2 = 'type_2';
|
||||
var data2 = {
|
||||
name: 'testName2',
|
||||
type: 'testType2'
|
||||
};
|
||||
};
|
||||
|
||||
describe('Lawnchair DAO unit tests', function() {
|
||||
describe('Lawnchair DAO unit tests', function() {
|
||||
var lawnchairDao;
|
||||
|
||||
beforeEach(function(done) {
|
||||
@ -147,6 +145,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
@ -1,16 +1,13 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
LoginCtrl = require('js/controller/login'),
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
Auth = require('js/bo/auth'),
|
||||
appController = require('js/app-controller'),
|
||||
KeychainDAO = require('js/dao/keychain-dao');
|
||||
var mocks = angular.mocks,
|
||||
LoginCtrl = require('../../src/js/controller/login'),
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
Auth = require('../../src/js/bo/auth'),
|
||||
appController = require('../../src/js/app-controller'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao');
|
||||
|
||||
describe('Login Controller unit test', function() {
|
||||
describe('Login Controller unit test', function() {
|
||||
var scope, location, ctrl,
|
||||
origEmailDao, emailDaoMock,
|
||||
origKeychain, keychainMock,
|
||||
@ -234,5 +231,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,16 +1,13 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
Auth = require('js/bo/auth'),
|
||||
mocks = require('angularMocks'),
|
||||
LoginExistingCtrl = require('js/controller/login-existing'),
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
appController = require('js/app-controller');
|
||||
var Auth = require('../../src/js/bo/auth'),
|
||||
mocks = angular.mocks,
|
||||
LoginExistingCtrl = require('../../src/js/controller/login-existing'),
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao'),
|
||||
appController = require('../../src/js/app-controller');
|
||||
|
||||
describe('Login (existing user) Controller unit test', function() {
|
||||
describe('Login (existing user) Controller unit test', function() {
|
||||
var scope, location, ctrl, origEmailDao, emailDaoMock,
|
||||
origAuth, authMock,
|
||||
emailAddress = 'fred@foo.com',
|
||||
@ -113,5 +110,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,16 +1,13 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
Auth = require('js/bo/auth'),
|
||||
mocks = require('angularMocks'),
|
||||
LoginInitialCtrl = require('js/controller/login-initial'),
|
||||
PGP = require('js/crypto/pgp'),
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
appController = require('js/app-controller');
|
||||
var Auth = require('../../src/js/bo/auth'),
|
||||
mocks = angular.mocks,
|
||||
LoginInitialCtrl = require('../../src/js/controller/login-initial'),
|
||||
PGP = require('../../src/js/crypto/pgp'),
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
appController = require('../../src/js/app-controller');
|
||||
|
||||
describe('Login (initial user) Controller unit test', function() {
|
||||
describe('Login (initial user) Controller unit test', function() {
|
||||
var scope, ctrl, location, origEmailDao, emailDaoMock,
|
||||
origAuth, authMock,
|
||||
emailAddress = 'fred@foo.com',
|
||||
@ -197,6 +194,4 @@ define(function(require) {
|
||||
scope.generateKey();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
@ -1,16 +1,13 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
PGP = require('js/crypto/pgp'),
|
||||
LoginNewDeviceCtrl = require('js/controller/login-new-device'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
appController = require('js/app-controller');
|
||||
var mocks = angular.mocks,
|
||||
PGP = require('../../src/js/crypto/pgp'),
|
||||
LoginNewDeviceCtrl = require('../../src/js/controller/login-new-device'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao'),
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
appController = require('../../src/js/app-controller');
|
||||
|
||||
describe('Login (new device) Controller unit test', function() {
|
||||
describe('Login (new device) Controller unit test', function() {
|
||||
var scope, ctrl, origEmailDao, emailDaoMock, pgpMock,
|
||||
emailAddress = 'fred@foo.com',
|
||||
passphrase = 'asd',
|
||||
@ -186,5 +183,4 @@ define(function(require) {
|
||||
expect(keychainMock.getUserKeyPair.calledOnce).to.be.true;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,16 +1,13 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
Auth = require('js/bo/auth'),
|
||||
LoginPrivateKeyDownloadCtrl = require('js/controller/login-privatekey-download'),
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
appController = require('js/app-controller'),
|
||||
KeychainDAO = require('js/dao/keychain-dao');
|
||||
var mocks = angular.mocks,
|
||||
Auth = require('../../src/js/bo/auth'),
|
||||
LoginPrivateKeyDownloadCtrl = require('../../src/js/controller/login-privatekey-download'),
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
appController = require('../../src/js/app-controller'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao');
|
||||
|
||||
describe('Login Private Key Download Controller unit test', function() {
|
||||
describe('Login Private Key Download Controller unit test', function() {
|
||||
var scope, location, ctrl,
|
||||
origEmailDao, emailDaoMock,
|
||||
origAuth, authMock,
|
||||
@ -260,5 +257,4 @@ define(function(require) {
|
||||
scope.goTo('/desktop');
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,15 +1,12 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
Auth = require('js/bo/auth'),
|
||||
ConnectionDoctor = require('js/util/connection-doctor'),
|
||||
SetCredentialsCtrl = require('js/controller/login-set-credentials'),
|
||||
appController = require('js/app-controller');
|
||||
var mocks = angular.mocks,
|
||||
Auth = require('../../src/js/bo/auth'),
|
||||
ConnectionDoctor = require('../../src/js/util/connection-doctor'),
|
||||
SetCredentialsCtrl = require('../../src/js/controller/login-set-credentials'),
|
||||
appController = require('../../src/js/app-controller');
|
||||
|
||||
describe('Login (Set Credentials) Controller unit test', function() {
|
||||
describe('Login (Set Credentials) Controller unit test', function() {
|
||||
// Angular parameters
|
||||
var scope, location, provider;
|
||||
|
||||
@ -97,5 +94,4 @@ define(function(require) {
|
||||
expect(auth.setCredentials.calledOnce).to.be.true;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,19 +1,16 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
MailListCtrl = require('js/controller/mail-list'),
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
DeviceStorageDAO = require('js/dao/devicestorage-dao'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
appController = require('js/app-controller'),
|
||||
notification = require('js/util/notification');
|
||||
var mocks = angular.mocks,
|
||||
MailListCtrl = require('../../src/js/controller/mail-list'),
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
DeviceStorageDAO = require('../../src/js/dao/devicestorage-dao'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao'),
|
||||
appController = require('../../src/js/app-controller'),
|
||||
notification = require('../../src/js/util/notification');
|
||||
|
||||
chai.Assertion.includeStack = true;
|
||||
chai.Assertion.includeStack = true;
|
||||
|
||||
describe('Mail List controller unit test', function() {
|
||||
describe('Mail List controller unit test', function() {
|
||||
var scope, ctrl, origEmailDao, emailDaoMock, keychainMock, deviceStorageMock,
|
||||
emailAddress, emails,
|
||||
hasChrome, hasSocket, hasRuntime, hasIdentity;
|
||||
@ -447,5 +444,4 @@ define(function(require) {
|
||||
expect(scope.state.mailList.selected).to.exist;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,113 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
// Mozilla bind polyfill because phantomjs is stupid
|
||||
if (!Function.prototype.bind) {
|
||||
Function.prototype.bind = function(oThis) {
|
||||
if (typeof this !== "function") {
|
||||
// closest thing possible to the ECMAScript 5 internal IsCallable function
|
||||
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");
|
||||
}
|
||||
|
||||
var aArgs = Array.prototype.slice.call(arguments, 1),
|
||||
fToBind = this,
|
||||
FNOP = function() {},
|
||||
fBound = function() {
|
||||
return fToBind.apply(this instanceof FNOP && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
|
||||
};
|
||||
|
||||
FNOP.prototype = this.prototype;
|
||||
fBound.prototype = new FNOP();
|
||||
|
||||
return fBound;
|
||||
};
|
||||
}
|
||||
|
||||
// a warm round of applause for phantomjs for missing events
|
||||
(function() {
|
||||
function CustomEvent(event, params) {
|
||||
params = params || {
|
||||
bubbles: false,
|
||||
cancelable: false,
|
||||
detail: undefined
|
||||
};
|
||||
var evt = document.createEvent('CustomEvent');
|
||||
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
||||
return evt;
|
||||
}
|
||||
|
||||
CustomEvent.prototype = window.Event.prototype;
|
||||
|
||||
window.CustomEvent = CustomEvent;
|
||||
})();
|
||||
|
||||
require(['../../src/require-config'], function() {
|
||||
require.config({
|
||||
baseUrl: '../../src/lib',
|
||||
paths: {
|
||||
angularMocks: '../../test/lib/angular-mocks'
|
||||
},
|
||||
shim: {
|
||||
angularMocks: {
|
||||
exports: 'angular.mock',
|
||||
deps: ['angular']
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Start the main app logic.
|
||||
require(['js/app-config', 'axe'], function(app, axe) {
|
||||
app.config.workerPath = '../../src/js';
|
||||
|
||||
// turn off logging in the test
|
||||
axe.removeAppender(axe.defaultAppender);
|
||||
|
||||
startTests();
|
||||
});
|
||||
});
|
||||
|
||||
function startTests() {
|
||||
mocha.setup('bdd');
|
||||
|
||||
require(
|
||||
[
|
||||
'test/unit/oauth-test',
|
||||
'test/unit/auth-test',
|
||||
'test/unit/email-dao-test',
|
||||
'test/unit/app-controller-test',
|
||||
'test/unit/pgp-test',
|
||||
'test/unit/crypto-test',
|
||||
'test/unit/backbutton-handler-test',
|
||||
'test/unit/rest-dao-test',
|
||||
'test/unit/admin-dao-test',
|
||||
'test/unit/publickey-dao-test',
|
||||
'test/unit/privatekey-dao-test',
|
||||
'test/unit/lawnchair-dao-test',
|
||||
'test/unit/keychain-dao-test',
|
||||
'test/unit/devicestorage-dao-test',
|
||||
'test/unit/dialog-ctrl-test',
|
||||
'test/unit/add-account-ctrl-test',
|
||||
'test/unit/account-ctrl-test',
|
||||
'test/unit/set-passphrase-ctrl-test',
|
||||
'test/unit/contacts-ctrl-test',
|
||||
'test/unit/login-existing-ctrl-test',
|
||||
'test/unit/login-initial-ctrl-test',
|
||||
'test/unit/login-new-device-ctrl-test',
|
||||
'test/unit/login-privatekey-download-ctrl-test',
|
||||
'test/unit/login-set-credentials-ctrl-test',
|
||||
'test/unit/privatekey-upload-ctrl-test',
|
||||
'test/unit/login-ctrl-test',
|
||||
'test/unit/read-ctrl-test',
|
||||
'test/unit/navigation-ctrl-test',
|
||||
'test/unit/mail-list-ctrl-test',
|
||||
'test/unit/write-ctrl-test',
|
||||
'test/unit/outbox-bo-test',
|
||||
'test/unit/invitation-dao-test',
|
||||
'test/unit/update-handler-test',
|
||||
'test/unit/connection-doctor-test'
|
||||
], function() {
|
||||
//Tests loaded, run tests
|
||||
mocha.run();
|
||||
}
|
||||
);
|
||||
}
|
@ -1,15 +1,12 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
NavigationCtrl = require('js/controller/navigation'),
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
OutboxBO = require('js/bo/outbox'),
|
||||
appController = require('js/app-controller');
|
||||
var mocks = angular.mocks,
|
||||
NavigationCtrl = require('../../src/js/controller/navigation'),
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
OutboxBO = require('../../src/js/bo/outbox'),
|
||||
appController = require('../../src/js/app-controller');
|
||||
|
||||
describe('Navigation Controller unit test', function() {
|
||||
describe('Navigation Controller unit test', function() {
|
||||
var scope, ctrl, origEmailDao, emailDaoMock, outboxBoMock, outboxFolder, onConnectStub;
|
||||
|
||||
beforeEach(function(done) {
|
||||
@ -97,5 +94,4 @@ define(function(require) {
|
||||
expect(outboxFolder.count).to.equal(5);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,11 +1,9 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var OAuth = require('js/util/oauth'),
|
||||
RestDAO = require('js/dao/rest-dao'),
|
||||
expect = chai.expect;
|
||||
var OAuth = require('../../src/js/util/oauth'),
|
||||
RestDAO = require('../../src/js/dao/rest-dao');
|
||||
|
||||
describe('OAuth unit tests', function() {
|
||||
describe('OAuth unit tests', function() {
|
||||
var oauth, googleApiStub, identityStub, getPlatformInfoStub, removeCachedStub,
|
||||
testEmail = 'test@example.com';
|
||||
|
||||
@ -197,5 +195,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
@ -1,15 +1,13 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
OutboxBO = require('js/bo/outbox'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
DeviceStorageDAO = require('js/dao/devicestorage-dao');
|
||||
var OutboxBO = require('../../src/js/bo/outbox'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao'),
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
DeviceStorageDAO = require('../../src/js/dao/devicestorage-dao');
|
||||
|
||||
chai.Assertion.includeStack = true;
|
||||
chai.Assertion.includeStack = true;
|
||||
|
||||
describe('Outbox Business Object unit test', function() {
|
||||
describe('Outbox Business Object unit test', function() {
|
||||
var outbox, emailDaoStub, devicestorageStub, keychainStub,
|
||||
dummyUser = 'spiderpig@springfield.com';
|
||||
|
||||
@ -276,5 +274,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,11 +1,8 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var PGP = require('js/crypto/pgp'),
|
||||
openpgp = require('openpgp'),
|
||||
expect = chai.expect;
|
||||
var PGP = require('../../src/js/crypto/pgp');
|
||||
|
||||
describe('PGP Crypto Api unit tests', function() {
|
||||
describe('PGP Crypto Api unit tests', function() {
|
||||
this.timeout(20000);
|
||||
|
||||
var pgp,
|
||||
@ -460,5 +457,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,11 +1,9 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var RestDAO = require('js/dao/rest-dao'),
|
||||
PrivateKeyDAO = require('js/dao/privatekey-dao'),
|
||||
expect = chai.expect;
|
||||
var RestDAO = require('../../src/js/dao/rest-dao'),
|
||||
PrivateKeyDAO = require('../../src/js/dao/privatekey-dao');
|
||||
|
||||
describe('Private Key DAO unit tests', function() {
|
||||
describe('Private Key DAO unit tests', function() {
|
||||
|
||||
var privkeyDao, restDaoStub,
|
||||
emailAddress = 'test@example.com',
|
||||
@ -221,6 +219,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
@ -1,15 +1,12 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
PrivateKeyUploadCtrl = require('js/controller/privatekey-upload'),
|
||||
appController = require('js/app-controller'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
PGP = require('js/crypto/pgp');
|
||||
var mocks = angular.mocks,
|
||||
PrivateKeyUploadCtrl = require('../../src/js/controller/privatekey-upload'),
|
||||
appController = require('../../src/js/app-controller'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao'),
|
||||
PGP = require('../../src/js/crypto/pgp');
|
||||
|
||||
describe('Private Key Upload Controller unit test', function() {
|
||||
describe('Private Key Upload Controller unit test', function() {
|
||||
var scope, location, ctrl,
|
||||
origEmailDao, emailDaoMock,
|
||||
origKeychain, keychainMock,
|
||||
@ -281,6 +278,4 @@ define(function(require) {
|
||||
scope.goForward();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
@ -1,11 +1,9 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var RestDAO = require('js/dao/rest-dao'),
|
||||
PublicKeyDAO = require('js/dao/publickey-dao'),
|
||||
expect = chai.expect;
|
||||
var RestDAO = require('../../src/js/dao/rest-dao'),
|
||||
PublicKeyDAO = require('../../src/js/dao/publickey-dao');
|
||||
|
||||
describe('Public Key DAO unit tests', function() {
|
||||
describe('Public Key DAO unit tests', function() {
|
||||
|
||||
var pubkeyDao, restDaoStub;
|
||||
|
||||
@ -72,7 +70,7 @@ define(function(require) {
|
||||
|
||||
pubkeyDao.verify(uuid, function(err) {
|
||||
expect(err).to.not.exist;
|
||||
expect(restDaoStub.get.calledWith(sinon.match(function(arg){
|
||||
expect(restDaoStub.get.calledWith(sinon.match(function(arg) {
|
||||
return arg.uri === '/verify/' + uuid && arg.type === 'text';
|
||||
}))).to.be.true;
|
||||
done();
|
||||
@ -160,6 +158,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
@ -1,17 +1,14 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
InvitationDAO = require('js/dao/invitation-dao'),
|
||||
PGP = require('js/crypto/pgp'),
|
||||
ReadCtrl = require('js/controller/read'),
|
||||
OutboxBO = require('js/bo/outbox'),
|
||||
appController = require('js/app-controller');
|
||||
var mocks = angular.mocks,
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao'),
|
||||
InvitationDAO = require('../../src/js/dao/invitation-dao'),
|
||||
PGP = require('../../src/js/crypto/pgp'),
|
||||
ReadCtrl = require('../../src/js/controller/read'),
|
||||
OutboxBO = require('../../src/js/bo/outbox'),
|
||||
appController = require('../../src/js/app-controller');
|
||||
|
||||
describe('Read Controller unit test', function() {
|
||||
describe('Read Controller unit test', function() {
|
||||
var scope, ctrl,
|
||||
origKeychain, keychainMock,
|
||||
origInvitation, invitationMock,
|
||||
@ -193,5 +190,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
@ -1,10 +1,8 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var RestDAO = require('js/dao/rest-dao'),
|
||||
expect = chai.expect;
|
||||
var RestDAO = require('../../src/js/dao/rest-dao');
|
||||
|
||||
describe('Rest DAO unit tests', function() {
|
||||
describe('Rest DAO unit tests', function() {
|
||||
|
||||
var restDao, xhrMock, requests;
|
||||
|
||||
@ -220,6 +218,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
@ -1,15 +1,12 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
SetPassphraseCtrl = require('js/controller/set-passphrase'),
|
||||
PGP = require('js/crypto/pgp'),
|
||||
appController = require('js/app-controller'),
|
||||
KeychainDAO = require('js/dao/keychain-dao');
|
||||
var mocks = angular.mocks,
|
||||
SetPassphraseCtrl = require('../../src/js/controller/set-passphrase'),
|
||||
PGP = require('../../src/js/crypto/pgp'),
|
||||
appController = require('../../src/js/app-controller'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao');
|
||||
|
||||
describe('Set Passphrase Controller unit test', function() {
|
||||
describe('Set Passphrase Controller unit test', function() {
|
||||
var scope, setPassphraseCtrl,
|
||||
dummyFingerprint, expectedFingerprint,
|
||||
dummyKeyId, expectedKeyId,
|
||||
@ -122,5 +119,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
@ -1,14 +1,12 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var DeviceStorageDAO = require('js/dao/devicestorage-dao'),
|
||||
Auth = require('js/bo/auth'),
|
||||
cfg = require('js/app-config').config,
|
||||
UpdateHandler = require('js/util/update/update-handler'),
|
||||
config = require('js/app-config').config,
|
||||
expect = chai.expect;
|
||||
var DeviceStorageDAO = require('../../src/js/dao/devicestorage-dao'),
|
||||
Auth = require('../../src/js/bo/auth'),
|
||||
cfg = require('../../src/js/app-config').config,
|
||||
UpdateHandler = require('../../src/js/util/update/update-handler'),
|
||||
config = require('../../src/js/app-config').config;
|
||||
|
||||
describe('UpdateHandler', function() {
|
||||
describe('UpdateHandler', function() {
|
||||
var updateHandler, appConfigStorageStub, authStub, userStorageStub, origDbVersion;
|
||||
|
||||
chai.Assertion.includeStack = true;
|
||||
@ -470,5 +468,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
@ -1,16 +1,13 @@
|
||||
define(function(require) {
|
||||
'use strict';
|
||||
'use strict';
|
||||
|
||||
var expect = chai.expect,
|
||||
angular = require('angular'),
|
||||
mocks = require('angularMocks'),
|
||||
WriteCtrl = require('js/controller/write'),
|
||||
EmailDAO = require('js/dao/email-dao'),
|
||||
OutboxBO = require('js/bo/outbox'),
|
||||
KeychainDAO = require('js/dao/keychain-dao'),
|
||||
appController = require('js/app-controller');
|
||||
var mocks = angular.mocks,
|
||||
WriteCtrl = require('../../src/js/controller/write'),
|
||||
EmailDAO = require('../../src/js/dao/email-dao'),
|
||||
OutboxBO = require('../../src/js/bo/outbox'),
|
||||
KeychainDAO = require('../../src/js/dao/keychain-dao'),
|
||||
appController = require('../../src/js/app-controller');
|
||||
|
||||
describe('Write controller unit test', function() {
|
||||
describe('Write controller unit test', function() {
|
||||
var ctrl, scope,
|
||||
origEmailDao, origOutbox, origKeychain,
|
||||
emailDaoMock, keychainMock, outboxMock, emailAddress, realname;
|
||||
@ -397,5 +394,4 @@ define(function(require) {
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user