Skip to content

Commit

Permalink
test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
junaidrsd committed May 10, 2016
1 parent 543b290 commit ee28c35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/app/js/controllers/sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ angular.module('sgApp')
}

$scope.isMainSection = function(section) {
return $scope.currentSection.indexOf('.') === -1;
return section.reference.indexOf('.') === -1;
};

$scope.isEmptyMainSection = function(section) {
Expand Down
10 changes: 10 additions & 0 deletions test/angular/unit/controllers/sections.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ describe('SectionsCtrl', function() {
});

describe('empty main section detection', function() {
it('should return true if main section', function() {
var section = {
header: 'Section header text',
reference: '1',
renderMarkup: '',
markup: ''
};
expect(scope.isMainSection(section)).to.eql(true);
});

it('should return true for empty main sections', function() {
var section = {
header: 'Section header text',
Expand Down

0 comments on commit ee28c35

Please sign in to comment.