Wallet/test/controllers/join.test.js
Matias Alejo Garcia aec2aac47b Add controller tests (#4205)
* add walletHome test template

* add create test

* add fixtures

* do not mock parseSecret

* better hash

* use fixtures for create controller test

* add import test

* stubs reset

* add more controller tests

* Remove $state dependency

* refactore fixtures + profiles

* add backup.js test

* update bwc

* rm log
2016-05-20 11:50:55 -03:00

72 lines
1.6 KiB
JavaScript

describe('joinController', function() {
var walletService;
var fakeNotification = {};
mocks.init({}, 'joinController');
// Init config
beforeEach(function(done) {
inject(function($rootScope, $controller, _configService_, _profileService_) {
scope = $rootScope.$new();
_configService_.get(function() {
join = $controller('joinController', {
$scope: scope,
$modal: mocks.fakeModal,
notification: fakeNotification,
configService: _configService_,
profileService: _profileService_,
});
done();
});
});
});
it.skip('should be defined', function() {
should.exist(join);
});
// // Get html template from cache
// beforeEach(inject(function($templateCache) {
// viewHtml = $templateCache.get("some/valid/templateUrl");
// }));
// // beforeEach(inject(function(_$compile_, _$rootScope_){
// $compile = _$compile_;
// $rootScope = _$rootScope_;
//
// $scope = $rootScope.$new();
// $scope.user = {};
// $scope.logout = sinon.stub();
// dropdownElement = angular.element(viewHtml);
// }));
it.skip('should join a wallet once the form is submitted', function(done) {
// View's joinForm is not available
//join.onQrCodeScanned('aQRCode');
var fakeForm = {
secret: {
$modelValue: 'anInvitationCode'
},
myName: {
$modelValue: 'myCopayerName'
},
bwsurl: 'aFakeURL',
createPassphrase: {
$modelValue: null
},
};
join.join(fakeForm);
should.not.exist(join.error);
});
});