Adds tests for csv download

This commit is contained in:
Matias Alejo Garcia 2016-06-03 15:21:30 -03:00
commit aa076d7ccd
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
4 changed files with 115 additions and 64 deletions

View file

@ -105,7 +105,7 @@ mocks.init = function(fixtures, controllerName, opts, done) {
var headers = JSON.stringify(bwc._getHeaders(method, url, args));
// Fixes BWC version... TODO
headers=headers.replace(/bwc-\d\.\d\.\d/,'bwc-2.4.0')
headers = headers.replace(/bwc-\d\.\d\.\d/, 'bwc-2.4.0')
var x = method + url + JSON.stringify(args) + headers;
var sjcl = $delegate.getSJCL();
return sjcl.codec.hex.fromBits(sjcl.hash.sha256.hash(x));
@ -163,7 +163,7 @@ mocks.init = function(fixtures, controllerName, opts, done) {
});
module('copayApp.controllers');
inject(function($rootScope, $controller, $injector, _configService_, _profileService_, _storageService_) {
inject(function($rootScope, $controller, $injector, lodash, _configService_, _profileService_, _storageService_) {
scope = $rootScope.$new();
storageService = _storageService_;
@ -198,6 +198,13 @@ mocks.init = function(fixtures, controllerName, opts, done) {
if (opts.initController)
startController();
if (opts.loadStorage) {
lodash.each(opts.loadStorage, function(v, k) {
localStorage.setItem(k, v);
});
}
if (opts.loadProfile) {
localStorage.setItem('profile', JSON.stringify(opts.loadProfile));