Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
fix(scrollfix): Fixed tests broken in previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ProLoser committed Jun 30, 2013
1 parent a347ed2 commit 449d684
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions modules/scrollfix/test/scrollfixSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,29 +11,29 @@ describe('uiScrollfix', function () {
}));

describe('compiling this directive', function () {
it('should bind to window "scroll" event with a ui-scrollfix namespace', function () {
it('should bind to window "scroll" event', function () {
spyOn($.fn, 'bind');
$compile('<div ui-scrollfix="100"></div>')(scope);
expect($.fn.bind).toHaveBeenCalled();
expect($.fn.bind.mostRecentCall.args[0]).toBe('scroll.ui-scrollfix');
expect($.fn.bind.mostRecentCall.args[0]).toBe('scroll');
});
});
describe('scrolling the window', function () {
it('should add the ui-scrollfix class if the offset is greater than specified', function () {
var element = $compile('<div ui-scrollfix="-100"></div>')(scope);
angular.element($window).trigger('scroll.ui-scrollfix');
angular.element($window).trigger('scroll');
expect(element.hasClass('ui-scrollfix')).toBe(true);
});
it('should remove the ui-scrollfix class if the offset is less than specified (using absolute coord)', function () {
var element = $compile('<div ui-scrollfix="100" class="ui-scrollfix"></div>')(scope);
angular.element($window).trigger('scroll.ui-scrollfix');
angular.element($window).trigger('scroll');
expect(element.hasClass('ui-scrollfix')).toBe(false);

});
it('should remove the ui-scrollfix class if the offset is less than specified (using relative coord)', function () {
var element = $compile('<div ui-scrollfix="+100" class="ui-scrollfix"></div>')(scope);
angular.element($window).trigger('scroll.ui-scrollfix');
angular.element($window).trigger('scroll');
expect(element.hasClass('ui-scrollfix')).toBe(false);
});
});
});
});

0 comments on commit 449d684

Please sign in to comment.