test(tags): moved code used on a single test to the correct place
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
95ff46db09
commit
f74d2cc302
|
@ -11,13 +11,13 @@ describe('Item', () => {
|
||||||
beforeEach(inject(($componentController, $rootScope) => {
|
beforeEach(inject(($componentController, $rootScope) => {
|
||||||
$scope = $rootScope.$new();
|
$scope = $rootScope.$new();
|
||||||
$scope.model = crudModel;
|
$scope.model = crudModel;
|
||||||
$scope.model.data = [{priority: 1}, {priority: 2}, {priority: 1}];
|
|
||||||
const $element = angular.element('<vn-item-tags></vn-item-tags>');
|
const $element = angular.element('<vn-item-tags></vn-item-tags>');
|
||||||
controller = $componentController('vnItemTags', {$element, $scope});
|
controller = $componentController('vnItemTags', {$element, $scope});
|
||||||
}));
|
}));
|
||||||
|
|
||||||
describe('getHighestPriority', () => {
|
describe('getHighestPriority', () => {
|
||||||
it('should return the highest priority value + 1 from the array', () => {
|
it('should return the highest priority value + 1 from the array', () => {
|
||||||
|
$scope.model.data = [{priority: 1}, {priority: 2}, {priority: 1}];
|
||||||
let result = controller.getHighestPriority();
|
let result = controller.getHighestPriority();
|
||||||
|
|
||||||
expect(result).toEqual(3);
|
expect(result).toEqual(3);
|
||||||
|
|
Loading…
Reference in New Issue