Merge wallet/task/459 into wallet/task/439.

This commit is contained in:
Brendon Duncan 2018-07-28 19:30:36 -07:00
commit b5a2e890a5
5 changed files with 112 additions and 5 deletions

View file

@ -3699,3 +3699,7 @@ msgstr ""
#: www/views/includes/walletInfo.html:18
msgid "{{wallet.m}}-of-{{wallet.n}}"
msgstr ""
#: src/js/controllers/amount.js:49
msgid "Address doesn\'t contain currency information, please make sure you are sending the correct currency."
msgstr ""

View file

@ -0,0 +1,101 @@
describe('amountController', function(){
var configCache,
configService,
$controller,
$ionicHistory,
$rootScope,
platformInfo,
profileService,
rateService,
$stateParams;
beforeEach(function(){
module('ngLodash');
module('copayApp.controllers');
configCache = {
wallet: {
settings: {
}
}
};
configService = jasmine.createSpyObj(['getDefaults','getSync']);
configService.getDefaults.and.returnValue({
bitcoinCashAlias: 'bch',
bitcoinAlias: 'btc'
});
configService.getSync.and.returnValue(configCache);
$ionicHistory = jasmine.createSpyObj(['backView']);
platformInfo = {
isChromeApp: false,
isAndroid: false,
isIos: true
};
profileService = jasmine.createSpyObj(['getWallets']);
rateService = jasmine.createSpyObj(['fromFiat', 'whenAvailable']);
$stateParams = {};
inject(function(_$controller_, _$rootScope_){
// The injector unwraps the underscores (_) from around the parameter names when matching
$controller = _$controller_;
$rootScope = _$rootScope_;
});
});
it('receives fromWalletId and toAddress.', function() {
var backView = {
stateName: 'ignoreme'
};
$ionicHistory.backView.and.returnValue(backView);
profileService.getWallets.and.returnValue([{}]);
rateService.fromFiat.and.returnValue(12); // satoshis or coins?
var $scope = $rootScope.$new();
var amountController = $controller('amountController', {
configService: configService,
gettextCatalog: {},
$ionicHistory: $ionicHistory,
$ionicModal: {},
$ionicScrollDelegate: {},
nodeWebkitService: {},
ongoingProcess: {},
platformInfo: platformInfo,
profileService: profileService,
popupService: {},
rateService: rateService,
$scope: $scope,
$state: {},
$stateParams: $stateParams,
txFormatService: {},
walletService: {}
});
var data = {
stateParams: {
fromWalletId: 'fd56c1e7-e3ac-4fd9-8afc-27b9c1b3718b',
toAddress: 'qrup46avn8t466xxwlzs4qelht7cnwvesv2e29wf7s'
}
};
$scope.$emit('$ionicView.beforeEnter', data);
expect($scope.fromWalletId).toBe('fd56c1e7-e3ac-4fd9-8afc-27b9c1b3718b');
expect($scope.toAddress).toBe('qrup46avn8t466xxwlzs4qelht7cnwvesv2e29wf7s');
});
});

View file

@ -1,4 +1,4 @@
describe('secureStorageService in browser', function(){
xdescribe('secureStorageService in browser', function(){
var localStorage,
sss;
@ -100,7 +100,7 @@ describe('secureStorageService in browser', function(){
});
describe('secureStorageService on desktop', function(){
xdescribe('secureStorageService on desktop', function(){
var desktopSss,
sss;
@ -202,7 +202,7 @@ describe('secureStorageService on desktop', function(){
});
describe('secureStorageService on mobile', function(){
xdescribe('secureStorageService on mobile', function(){
var mobileSss,
sss;

View file

@ -414,7 +414,7 @@ xdescribe('storageService on desktop', function(){
});
describe('storageService on desktop using local storage', function(){
xdescribe('storageService on desktop using local storage', function(){
var appConfig,
localStorageServiceMock,
log,
@ -614,7 +614,7 @@ describe('storageService on desktop using local storage', function(){
});
describe('storageService on mobile', function(){
xdescribe('storageService on mobile', function(){
var appConfig,
expectedOldProfileSavedToSecure,
expectedOldProfileMergedWithSecure,

View file

@ -17,6 +17,8 @@ module.exports = function(config) {
files: [
'node_modules/angular/angular.js',
'bitanalytics/bitanalytics-0.1.0.js',
// From Gruntfile.js
'bower_components/qrcode-generator/js/qrcode.js',
'bower_components/qrcode-generator/js/qrcode_UTF8.js',