<commit_before>import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { Subject } from 'rxjs';

import { TestUtils } from '../../test';

import { ClipboardProvider } from '../../providers/clipboard/clipboard';
import { IncomingDataProvider } from '../../providers/incoming-data/incoming-data';
import { HomePage } from './home';

describe('HomePage', () => {
  let fixture: ComponentFixture<HomePage>;
  let instance;
  let testBed: typeof TestBed;

  beforeEach(async(() =>
    TestUtils.configurePageTestingModule([HomePage]).then(testEnv => {
      fixture = testEnv.fixture;
      instance = testEnv.instance;
      testBed = testEnv.testBed;
      instance.showCard = {
        setShowRateCard: () => {}
      };
      fixture.detectChanges();
    })));
  afterEach(() => {
    spyOn(instance, 'ngOnDestroy');
    fixture.destroy();
  });

  describe('Lifecycle Hooks', () => {
    describe('ionViewWillEnter', () => {
      describe('ionViewDidEnter', () => {
        it('should check clipboard', () => {
          const spy = spyOn(instance, 'checkClipboard');
          instance.ionViewDidEnter();
          expect(spy).toHaveBeenCalled();
        });
      });

      describe('ionViewDidLoad', () => {
        beforeEach(() => {
          instance.plt.resume = new Subject();
          instance.plt.pause = new Subject();
        });
        /* it('should subscribe to events', () => {
          const subscribeSpy = spyOn(instance.events, 'subscribe');
          instance.ionViewDidLoad();
          expect(subscribeSpy).toHaveBeenCalledWith(
            'bwsEvent',
            instance.bwsEventHandler
          );
          expect(subscribeSpy).toHaveBeenCalledWith(
            'Local/WalletListChange',
            instance.setWallets
          );
          expect(subscribeSpy).toHaveBeenCalledWith(
            'Local/TxAction',
            instance.walletFocusHandler
          );
          expect(subscribeSpy).toHaveBeenCalledWith(
            'Local/WalletFocus',
            instance.walletFocusHandler
          );
        }); TODO */
        it('should update wallets on platform resume', () => {
          instance.ionViewDidLoad();
          const setWalletsSpy = spyOn(instance, 'setWallets');
          instance.plt.resume.next();
          expect(setWalletsSpy).toHaveBeenCalled();
        });
      });

      describe('ionViewWillLeave', () => {
        it('should call resetValuesForAnimationCard', () => {
          const spy = spyOn(instance, 'resetValuesForAnimationCard');
          instance.ionViewWillLeave();
          expect(spy).toHaveBeenCalled();
        });
      });
    });
  });

  describe('Methods', () => {
    describe('checkClipboard', () => {<commit_msg>fixtests<commit_after>import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { Subject } from 'rxjs';

import { TestUtils } from '../../test';

import { ClipboardProvider } from '../../providers/clipboard/clipboard';
import { IncomingDataProvider } from '../../providers/incoming-data/incoming-data';
import { HomePage } from './home';

describe('HomePage', () => {
  let fixture: ComponentFixture<HomePage>;
  let instance;
  let testBed: typeof TestBed;

  beforeEach(async(() =>
    TestUtils.configurePageTestingModule([HomePage]).then(testEnv => {
      fixture = testEnv.fixture;
      instance = testEnv.instance;
      testBed = testEnv.testBed;
      instance.showCard = {
        setShowRateCard: () => {}
      };
      fixture.detectChanges();
    })));
  afterEach(() => {
    spyOn(instance, 'ngOnDestroy');
    fixture.destroy();
  });

  describe('Lifecycle Hooks', () => {
    describe('ionViewWillEnter', () => {
      describe('ionViewDidEnter', () => {
        it('should check clipboard', () => {
          const spy = spyOn(instance, 'checkClipboard');
          instance.ionViewDidEnter();
          expect(spy).toHaveBeenCalled();
        });
      });

      describe('ionViewDidLoad', () => {
        beforeEach(() => {
          instance.plt.resume = new Subject();
          instance.plt.pause = new Subject();
        });
        /* it('should subscribe to events', () => {
          const subscribeSpy = spyOn(instance.events, 'subscribe');
          instance.ionViewDidLoad();
          expect(subscribeSpy).toHaveBeenCalledWith(
            'bwsEvent',
            instance.bwsEventHandler
          );
          expect(subscribeSpy).toHaveBeenCalledWith(
            'Local/WalletListChange',
            instance.setWallets
          );
          expect(subscribeSpy).toHaveBeenCalledWith(
            'Local/TxAction',
            instance.walletActionHandler
          );
          expect(subscribeSpy).toHaveBeenCalledWith(
            'Local/WalletFocus',
            instance.walletFocusHandler
          );
        }); TODO */
        it('should update wallets on platform resume', () => {
          instance.ionViewDidLoad();
          const setWalletsSpy = spyOn(instance, 'setWallets');
          instance.plt.resume.next();
          expect(setWalletsSpy).toHaveBeenCalled();
        });
      });

      describe('ionViewWillLeave', () => {
        it('should call resetValuesForAnimationCard', () => {
          const spy = spyOn(instance, 'resetValuesForAnimationCard');
          instance.ionViewWillLeave();
          expect(spy).toHaveBeenCalled();
        });
      });
    });
  });

  describe('Methods', () => {
    describe('checkClipboard', () => {
{'fraction_non_alphanumeric': 0.14928649835345773, 'fraction_numerical': 0.0, 'mean_word_length': 2.410480349344978, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '2984146', 'n_tokens_mistral': 1501, 'n_tokens_neox': 1510, 'n_words': 238}