2014-04-23 09:21:33 -07:00
|
|
|
//
|
|
|
|
// test/unit/controllers/controllersSpec.js
|
|
|
|
//
|
|
|
|
describe("Unit: Testing Controllers", function() {
|
|
|
|
|
2014-06-04 07:24:49 -07:00
|
|
|
var scope;
|
2014-06-03 13:42:36 -07:00
|
|
|
|
2014-06-04 07:24:49 -07:00
|
|
|
beforeEach(module('notifications'));
|
|
|
|
beforeEach(module('copayApp.services'));
|
|
|
|
beforeEach(module('copayApp.controllers'));
|
|
|
|
|
|
|
|
describe('Address Controller', function() {
|
|
|
|
var addressCtrl;
|
2014-06-03 13:42:36 -07:00
|
|
|
beforeEach(inject(function($controller, $rootScope) {
|
|
|
|
scope = $rootScope.$new();
|
|
|
|
addressCtrl = $controller('AddressesController', {
|
|
|
|
$scope: scope,
|
|
|
|
});
|
|
|
|
}));
|
|
|
|
|
2014-06-04 07:24:49 -07:00
|
|
|
it('should have a AddressesController controller', function() {
|
|
|
|
expect(scope.loading).equal(false);
|
|
|
|
});
|
2014-06-03 13:42:36 -07:00
|
|
|
|
2014-06-04 07:24:49 -07:00
|
|
|
it('selectedAddr should modify scope', function() {
|
|
|
|
expect(scope.selectedAddress).equal(undefined);
|
|
|
|
scope.selectAddress('hola');
|
|
|
|
expect(scope.selectedAddr).equal('hola');
|
|
|
|
});
|
2014-06-03 13:42:36 -07:00
|
|
|
|
2014-06-04 07:24:49 -07:00
|
|
|
});
|
2014-06-03 13:42:36 -07:00
|
|
|
|
2014-06-04 07:24:49 -07:00
|
|
|
describe('Transactions Controller', function() {
|
|
|
|
var transactionCtrl;
|
|
|
|
beforeEach(inject(function($controller, $rootScope) {
|
|
|
|
scope = $rootScope.$new();
|
|
|
|
transactionsCtrl = $controller('TransactionsController', {
|
|
|
|
$scope: scope,
|
|
|
|
});
|
|
|
|
}));
|
|
|
|
|
|
|
|
it('should have a TransactionController controller', function() {
|
|
|
|
expect(scope.loading).equal(false);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should return an empty array of tx', function() {
|
|
|
|
scope.getTransactions();
|
|
|
|
expect(scope.blockchain_txs).to.be.empty;
|
|
|
|
console.log('asdfasdf', scope.blockchain_txs);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
2014-04-23 09:21:33 -07:00
|
|
|
});
|