copay/test/unit/controllers/controllersSpec.js

54 lines
1.4 KiB
JavaScript
Raw Normal View History

2014-04-23 09:21:33 -07:00
//
// test/unit/controllers/controllersSpec.js
//
describe("Unit: Testing Controllers", function() {
var scope;
2014-06-03 13:42:36 -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,
});
}));
it('should have a AddressesController controller', function() {
expect(scope.loading).equal(false);
});
2014-06-03 13:42:36 -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-03 13:42:36 -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
});