Skip to content

Instantly share code, notes, and snippets.

@JackTanRoo
Created September 24, 2014 19:52
Show Gist options
  • Save JackTanRoo/9d506865f80ab8c540aa to your computer and use it in GitHub Desktop.
Save JackTanRoo/9d506865f80ab8c540aa to your computer and use it in GitHub Desktop.
describe('Unit: sendFactory - TxBuilder', function () {
beforeEach(module('bitclip'));
var $scope, $rootScope, $location, $window, $q, $timeout, transactionDetails, createController, TxBuilder, tempStore;
beforeEach(inject(function($injector) {
$rootScope = $injector.get('$rootScope');
$location = $injector.get('$location');
$scope = $rootScope.$new();
$window = $injector.get('$window');
$timeout = $injector.get('$timeout');
TxBuilder = $injector.get('TxBuilder');
$q = $injector.get('$q');
transactionDetails = {
amount:"",
destination:""
};
}));
//this async test is not working properly
it.only('should return success when sending a correctly stated transaction', function (done) {
transactionDetails.amount = 0.01;
transactionDetails.destination = "mpduks3B8ULftm1hcbEf3jQU7iGae7mEMS";
TxBuilder.sendTransaction(tempStore.testNet.currentPrivateKey, transactionDetails,false)
.then(function(message){
expect(message).to.equal("Transaction successfully propagated");
done();
})
.catch(function(error){
done(error);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment