mirror of https://github.com/BTCPrivate/copay.git
fix signin and add tests
This commit is contained in:
parent
8d3d35ff83
commit
5e12523338
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
angular.module('copayApp.controllers').controller('SigninController',
|
angular.module('copayApp.controllers').controller('SigninController',
|
||||||
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase) {
|
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, backupService, notification) {
|
||||||
var cmp = function(o1, o2) {
|
var cmp = function(o1, o2) {
|
||||||
var v1 = o1.show.toLowerCase(),
|
var v1 = o1.show.toLowerCase(),
|
||||||
v2 = o2.show.toLowerCase();
|
v2 = o2.show.toLowerCase();
|
||||||
|
|
|
@ -12,6 +12,9 @@ saveAs = function(o) {
|
||||||
|
|
||||||
|
|
||||||
describe("Unit: Controllers", function() {
|
describe("Unit: Controllers", function() {
|
||||||
|
var invalidForm = {
|
||||||
|
$invalid: true
|
||||||
|
};
|
||||||
|
|
||||||
var scope;
|
var scope;
|
||||||
|
|
||||||
|
@ -75,10 +78,7 @@ describe("Unit: Controllers", function() {
|
||||||
});
|
});
|
||||||
describe('#create', function() {
|
describe('#create', function() {
|
||||||
it('should work with invalid form', function() {
|
it('should work with invalid form', function() {
|
||||||
var form = {
|
scope.create(invalidForm);
|
||||||
$invalid: true
|
|
||||||
};
|
|
||||||
scope.create(form);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -321,7 +321,30 @@ describe("Unit: Controllers", function() {
|
||||||
it('should exist', function() {
|
it('should exist', function() {
|
||||||
should.exist(what);
|
should.exist(what);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Signin Controller', function() {
|
||||||
|
var what;
|
||||||
|
beforeEach(inject(function($controller, $rootScope) {
|
||||||
|
scope = $rootScope.$new();
|
||||||
|
what = $controller('SigninController', {
|
||||||
|
$scope: scope,
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should exist', function() {
|
||||||
|
should.exist(what);
|
||||||
|
});
|
||||||
|
describe('#open', function() {
|
||||||
|
it('should work with invalid form', function() {
|
||||||
|
scope.open(invalidForm);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
describe('#join', function() {
|
||||||
|
it('should work with invalid form', function() {
|
||||||
|
scope.join(invalidForm);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue