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
This commit is contained in:
parent
335c3f00af
commit
aec2aac47b
20 changed files with 2265 additions and 28 deletions
72
test/controllers/join.test.js
Normal file
72
test/controllers/join.test.js
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
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);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue