mirror of
https://github.com/ansible/awx.git
synced 2026-03-05 10:41:05 -03:30
Fixed unit test
This commit is contained in:
@@ -38,16 +38,17 @@ describe('Directive: column-sort', () =>{
|
|||||||
go: jasmine.createSpy('go')
|
go: jasmine.createSpy('go')
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.$stateParams = {};
|
||||||
|
|
||||||
angular.mock.module('ColumnSortModule', ($provide) =>{
|
angular.mock.module('ColumnSortModule', ($provide) =>{
|
||||||
|
|
||||||
|
QuerySet = jasmine.createSpyObj('qs', ['search']);
|
||||||
QuerySet = jasmine.createSpyObj('qs', ['search']);
|
QuerySet.search.and.callFake(() => { return { then: function(){} }; });
|
||||||
QuerySet.search.and.callFake(() => { return { then: function(){} } });
|
GetBasePath = jasmine.createSpy('GetBasePath');
|
||||||
GetBasePath = jasmine.createSpy('GetBasePath');
|
$provide.value('QuerySet', QuerySet);
|
||||||
$provide.value('QuerySet', QuerySet);
|
$provide.value('GetBasePath', GetBasePath);
|
||||||
$provide.value('GetBasePath', GetBasePath);
|
$provide.value('$state', this.$state);
|
||||||
$provide.value('$state', this.$state);
|
$provide.value('$stateParams', this.$stateParams);
|
||||||
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -67,7 +68,7 @@ describe('Directive: column-sort', () =>{
|
|||||||
};
|
};
|
||||||
|
|
||||||
$compile(this.name_field)($scope);
|
$compile(this.name_field)($scope);
|
||||||
$compile(this.idx_field)($scope)
|
$compile(this.idx_field)($scope);
|
||||||
|
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
expect( $(this.name_field).find('.columnSortIcon').hasClass('fa-sort-up') ).toEqual(true);
|
expect( $(this.name_field).find('.columnSortIcon').hasClass('fa-sort-up') ).toEqual(true);
|
||||||
@@ -81,7 +82,7 @@ describe('Directive: column-sort', () =>{
|
|||||||
};
|
};
|
||||||
|
|
||||||
$compile(this.name_field)($scope);
|
$compile(this.name_field)($scope);
|
||||||
$compile(this.idx_field)($scope)
|
$compile(this.idx_field)($scope);
|
||||||
|
|
||||||
$scope.$digest();
|
$scope.$digest();
|
||||||
|
|
||||||
@@ -95,7 +96,7 @@ describe('Directive: column-sort', () =>{
|
|||||||
|
|
||||||
$(this.idx_field).click();
|
$(this.idx_field).click();
|
||||||
expect( $(this.name_field).find('.columnSortIcon').hasClass('fa-sort') ).toEqual(true);
|
expect( $(this.name_field).find('.columnSortIcon').hasClass('fa-sort') ).toEqual(true);
|
||||||
expect( $(this.idx_field).find('.columnSortIcon').hasClass('fa-sort-down') ).toEqual(true)
|
expect( $(this.idx_field).find('.columnSortIcon').hasClass('fa-sort-down') ).toEqual(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user