Fix karma test and added a new one
This commit is contained in:
parent
0a388c73ca
commit
bb587d0743
1 changed files with 19 additions and 3 deletions
|
|
@ -214,7 +214,7 @@ describe("Unit: Controllers", function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Unit: Sidebar Controller", function() {
|
describe("Unit: Version Controller", function() {
|
||||||
var scope, $httpBackendOut;
|
var scope, $httpBackendOut;
|
||||||
var GH = 'https://api.github.com/repos/bitpay/copay/tags';
|
var GH = 'https://api.github.com/repos/bitpay/copay/tags';
|
||||||
beforeEach(inject(function($controller, $injector) {
|
beforeEach(inject(function($controller, $injector) {
|
||||||
|
|
@ -235,7 +235,7 @@ describe("Unit: Controllers", function() {
|
||||||
beforeEach(inject(function($controller, $rootScope) {
|
beforeEach(inject(function($controller, $rootScope) {
|
||||||
rootScope = $rootScope;
|
rootScope = $rootScope;
|
||||||
scope = $rootScope.$new();
|
scope = $rootScope.$new();
|
||||||
headerCtrl = $controller('SidebarController', {
|
headerCtrl = $controller('VersionController', {
|
||||||
$scope: scope,
|
$scope: scope,
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
|
|
@ -273,8 +273,24 @@ describe("Unit: Controllers", function() {
|
||||||
scope.$apply();
|
scope.$apply();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return an array of n undefined elements', function() {
|
it('should return networkName', function() {
|
||||||
$httpBackend.flush(); // need flush
|
$httpBackend.flush(); // need flush
|
||||||
|
var networkName = scope.networkName;
|
||||||
|
expect(networkName).equal('livenet');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("Unit: Sidebar Controller", function() {
|
||||||
|
var rootScope;
|
||||||
|
beforeEach(inject(function($controller, $rootScope) {
|
||||||
|
rootScope = $rootScope;
|
||||||
|
scope = $rootScope.$new();
|
||||||
|
headerCtrl = $controller('SidebarController', {
|
||||||
|
$scope: scope,
|
||||||
|
});
|
||||||
|
}));
|
||||||
|
|
||||||
|
it('should return an array of n undefined elements', function() {
|
||||||
var n = 5;
|
var n = 5;
|
||||||
var array = scope.getNumber(n);
|
var array = scope.getNumber(n);
|
||||||
expect(array.length).equal(n);
|
expect(array.length).equal(n);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue