<commit_before>/*global describe, beforeEach, module, inject, it, spyOn, expect, $ */
describe('uiRemove', function () {
    'use strict';

    var scope, $compile, $window;
    beforeEach(module('ui.directives'));
    beforeEach(inject(function (_$rootScope_, _$compile_, _$window_) {
        scope = _$rootScope_.$new();
        $compile = _$compile_;
        $window = _$window_;
    }));

    describe('compiling this directive', function () {
        it('should bind to window "scroll" event with a ui-scrollfix namespace', 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');
        });
    });
    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);
            $($window).trigger('scroll.ui-scrollfix');
            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);
            $($window).trigger('scroll.ui-scrollfix');
            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);<commit_msg>fixing broken scrollfix test<commit_after>/*global describe, beforeEach, module, inject, it, spyOn, expect, $ */
describe('uiScrollfix', function () {
    'use strict';

    var scope, $compile, $window;
    beforeEach(module('ui.directives'));
    beforeEach(inject(function (_$rootScope_, _$compile_, _$window_) {
        scope = _$rootScope_.$new();
        $compile = _$compile_;
        $window = _$window_;
    }));

    describe('compiling this directive', function () {
        it('should bind to window "scroll" event with a ui-scrollfix namespace', function () {
            spyOn($.fn, 'on');
            $compile('<div ui-scrollfix="100"></div>')(scope);
            expect($.fn.on).toHaveBeenCalled();
            expect($.fn.on.mostRecentCall.args[0]).toBe('scroll.ui-scrollfix');
        });
    });
    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);
            $($window).trigger('scroll.ui-scrollfix');
            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);
            $($window).trigger('scroll.ui-scrollfix');
            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);
{'fraction_non_alphanumeric': 0.1678082191780822, 'fraction_numerical': 0.007420091324200913, 'mean_word_length': 3.0473441108545036, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '523851', 'n_tokens_mistral': 981, 'n_tokens_neox': 956, 'n_words': 232}