<commit_before>import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';

import { ElementHelpers } from '../../test/helpers';
import { AmdDialogComponent } from './amd-dialog.component';

describe('Component: amd-dialog', () => {
  let component: AmdDialogComponent;
  let fixture: ComponentFixture<AmdDialogComponent>;
  let debugElement: DebugElement;
  let element: HTMLElement;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [AmdDialogComponent]
    }).compileComponents().then(() => {
      fixture = TestBed.createComponent(AmdDialogComponent);
      component = fixture.componentInstance;
      debugElement = fixture.debugElement;
      element = debugElement.nativeElement;
      fixture.detectChanges();
    });
  }));

  describe('controller', () => {
    describe('constructor()', () => {
      it('should default isOpen to true', () => {
        expect(component.isOpen).toBe(true);
      });
    });

    describe('closeModal()', () => {
      it('should set isOpen to false', () => {
        expect(component.isOpen).toBe(true);

        component.closeModal();
        fixture.detectChanges();

        expect(component.isOpen).toBe(false);
      });
    });
  });

  describe('template', () => {
    let amdModalElem: DebugElement;
    let backdropElem: DebugElement;

    beforeEach(() => {<commit_msg>use karma async instead of angular async for testing<commit_after>import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { By } from '@angular/platform-browser';
import { DebugElement } from '@angular/core';

import { ElementHelpers } from '../../test/helpers';
import { AmdDialogComponent } from './amd-dialog.component';

describe('Component: amd-dialog', () => {
  let component: AmdDialogComponent;
  let fixture: ComponentFixture<AmdDialogComponent>;
  let debugElement: DebugElement;
  let element: HTMLElement;

  beforeEach((done: Function) => {
    TestBed.configureTestingModule({
      declarations: [AmdDialogComponent]
    }).compileComponents().then(() => {
      fixture = TestBed.createComponent(AmdDialogComponent);
      component = fixture.componentInstance;
      debugElement = fixture.debugElement;
      element = debugElement.nativeElement;
      fixture.detectChanges();
      done();
    });
  });

  describe('controller', () => {
    describe('constructor()', () => {
      it('should default isOpen to true', () => {
        expect(component.isOpen).toBe(true);
      });
    });

    describe('closeModal()', () => {
      it('should set isOpen to false', () => {
        expect(component.isOpen).toBe(true);

        component.closeModal();
        fixture.detectChanges();

        expect(component.isOpen).toBe(false);
      });
    });
  });

  describe('template', () => {
    let amdModalElem: DebugElement;
    let backdropElem: DebugElement;

    beforeEach(() => {
{'fraction_non_alphanumeric': 0.15543695797198132, 'fraction_numerical': 0.0, 'mean_word_length': 3.5233785822021115, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, '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': '7662117', 'n_tokens_mistral': 830, 'n_tokens_neox': 822, 'n_words': 162}