<commit_before>'use strict';

describe('scrollToFixed', function() {
  var $scope;
  var element;

  beforeEach(module('scrollToFixed'));

  beforeEach(inject(function($injector) {
    var $rootScope = $injector.get('$rootScope');
    $scope = $rootScope.$new();
  }));

  describe('functions', function() {
    describe('link', function() {
      var scrollToFixed;

      beforeEach(function() {
        scrollToFixed = spyOn(angular.element.fn, 'scrollToFixed');
      });

      describe('when there are options', function() {
        beforeEach(inject(function($injector) {
          var $compile = $injector.get('$compile');
          var template =
            '<div scroll-to-fixed="{\'bottom\': 0}">' +
              'Hello, world!' +
            '</div>';
          element = $compile(template)($scope);
        }));

        it('should call angular.element.fn.scrollToFixed', function() {
          expect(scrollToFixed).toHaveBeenCalledWith({'bottom': 0});
        });
      });

      describe('when there are no options', function() {
        beforeEach(inject(function($injector) {
          var $compile = $injector.get('$compile');
          var template = '<div scroll-to-fixed>Hello, world!</div>';
          element = $compile(template)($scope);
        }));

        it('should call angular.element.fn.scrollToFixed', function() {
          expect(scrollToFixed).toHaveBeenCalledWith(undefined);
        });
      });
    });
  });

  describe('events', function() {
    beforeEach(inject(function($injector) {
      var $compile = $injector.get('$compile');
      element = $compile('<div scroll-to-fixed>Hello, world!</div>')($scope);
    }));

    describe('update', function() {
      it('should trigger resize', function(done) {
        element.bind('resize', function() {
          done();
        });

        element.trigger('update');<commit_msg>Test custom ngModel<commit_after>'use strict';

describe('scrollToFixed', function() {
  var $scope;
  var element;

  beforeEach(module('scrollToFixed'));

  beforeEach(inject(function($injector) {
    var $rootScope = $injector.get('$rootScope');
    $scope = $rootScope.$new();
    $scope.name = 'Alan';
  }));

  describe('functions', function() {
    describe('link', function() {
      var scrollToFixed;

      beforeEach(function() {
        scrollToFixed = spyOn(angular.element.fn, 'scrollToFixed');
      });

      describe('when there are options', function() {
        beforeEach(inject(function($injector) {
          var $compile = $injector.get('$compile');
          var template =
            '<div scroll-to-fixed="{\'bottom\': 0}">' +
              'Hello, world!' +
            '</div>';
          element = $compile(template)($scope);
        }));

        it('should call angular.element.fn.scrollToFixed', function() {
          expect(scrollToFixed).toHaveBeenCalledWith({'bottom': 0});
        });
      });

      describe('when there are no options', function() {
        beforeEach(inject(function($injector) {
          var $compile = $injector.get('$compile');
          var template = '<div scroll-to-fixed>Hello, world!</div>';
          element = $compile(template)($scope);
        }));

        it('should call angular.element.fn.scrollToFixed', function() {
          expect(scrollToFixed).toHaveBeenCalledWith(undefined);
        });
      });
    });
  });

  describe('watchers', function() {
    describe('ngModel', function() {
      beforeEach(inject(function($injector) {
        var $compile = $injector.get('$compile');
        var template =
          '<div scroll-to-fixed ng-model="name">' +
            'Hello, {{ name }}!' +
          '</div>';
        element = $compile(template)($scope);
      }));

      it('should trigger resize', function(done) {
        element.bind('resize', function() {
          done();
        });

        $scope.name = 'Ada';
        $scope.$digest();
      });
    });
  });

  describe('events', function() {
    beforeEach(inject(function($injector) {
      var $compile = $injector.get('$compile');
      element = $compile('<div scroll-to-fixed>Hello, world!</div>')($scope);
    }));

    describe('update', function() {
      it('should trigger resize', function(done) {
        element.bind('resize', function() {
          done();
        });

        element.trigger('update');
{'fraction_non_alphanumeric': 0.17828387393604786, 'fraction_numerical': 0.0009201748332183115, 'mean_word_length': 2.617304492512479, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '3366039', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1223, 'n_words': 215}