<commit_before>import {
  async,
  inject
} from '@angular/core/testing';
import { InfiniteScrollDirective } from '../../src/modules/infinite-scroll.directive';
import { ScrollRegister } from '../../src/services/scroll-register';
import { ScrollResolver } from '../../src/services/scroll-resolver';

import { ElementRef, NgZone, SimpleChanges, SimpleChange } from '@angular/core';

describe('Infinite Scroll Directive', () => {
  // const zone = new NgZone({ enableLongStackTrace: false });
  let isScrollingDown = true;
  let zoneSpy: any, scrollResolverSpy: any, scrollRegisterSpy: any, positionResolverSpy: any;
  let directive: InfiniteScrollDirective;
  const positionFactoryMock: any =  {
    create: () => positionResolverSpy
  };
  const createMockElement = () => {
    const mockedElement: ElementRef = new ElementRef(document.createElement('div'));
    return mockedElement;
  };
  const createInfiniteScroll = (mockedElement?: any) => {
    mockedElement = mockedElement || createMockElement();
    return new InfiniteScrollDirective(
      mockedElement,
      zoneSpy,
      positionFactoryMock,
      scrollRegisterSpy,
      scrollResolverSpy
    );
  };

  beforeEach(() =>{
    zoneSpy = jasmine.createSpyObj('zone', ['run']);
    scrollResolverSpy = {
      getScrollStats: () => {
        return { shouldScroll: true, isScrollingDown };
      }
    };
    scrollRegisterSpy = jasmine.createSpyObj('register', ['attachEvent'])
    positionResolverSpy = jasmine.createSpyObj('pos', ['create', 'container']);<commit_msg>fixes broken tests<commit_after>import {
  async,
  inject
} from '@angular/core/testing';
import { InfiniteScrollDirective } from '../../src/modules/infinite-scroll.directive';
import { ScrollRegister } from '../../src/services/scroll-register';
import { ScrollResolver } from '../../src/services/scroll-resolver';

import { ElementRef, NgZone, SimpleChanges, SimpleChange } from '@angular/core';

describe('Infinite Scroll Directive', () => {
  // const zone = new NgZone({ enableLongStackTrace: false });
  let isScrollingDown = true;
  let zoneSpy: any, scrollResolverSpy: any, scrollRegisterSpy: any, positionResolverSpy: any;
  let directive: InfiniteScrollDirective;
  const positionFactoryMock: any =  {
    create: () => positionResolverSpy
  };
  const createMockElement = () => {
    const mockedElement: ElementRef = new ElementRef(document.createElement('div'));
    return mockedElement;
  };
  const createInfiniteScroll = (mockedElement?: any) => {
    mockedElement = mockedElement || createMockElement();
    return new InfiniteScrollDirective(
      mockedElement,
      zoneSpy,
      positionFactoryMock,
      scrollRegisterSpy,
      scrollResolverSpy
    );
  };

  beforeEach(() =>{
    zoneSpy = jasmine.createSpyObj('zone', ['run']);
    zoneSpy.runOutsideAngular = (fn) => fn();
    scrollResolverSpy = {
      getScrollStats: () => {
        return { shouldScroll: true, isScrollingDown };
      }
    };
    scrollRegisterSpy = jasmine.createSpyObj('register', ['attachEvent'])
    positionResolverSpy = jasmine.createSpyObj('pos', ['create', 'container']);
{'fraction_non_alphanumeric': 0.13544668587896252, 'fraction_numerical': 0.0, 'mean_word_length': 4.06320907617504, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 16, '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': '2133304', 'n_tokens_mistral': 908, 'n_tokens_neox': 894, 'n_words': 192}