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

import { AlarmComponent } from './alarm.component';

describe('AlarmComponent', () => {
  let component: AlarmComponent;
  let fixture: ComponentFixture<AlarmComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ AlarmComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(AlarmComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should be created', () => {
    expect(component).toBeTruthy();
  });
});<commit_msg>alarm tests<commit_after>import {async, ComponentFixture, TestBed} from '@angular/core/testing';

import {AlarmComponent} from './alarm.component';
import {AlarmStateToStringPipe} from './alarm.pipes';

describe('AlarmComponent', () => {
  let component: AlarmComponent;
  let fixture: ComponentFixture<AlarmComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [AlarmComponent, AlarmStateToStringPipe]
    })
      .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(AlarmComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should be created', () => {
    expect(component).toBeTruthy();
  });

  beforeEach(() => {
    component.alarm = {
      zones: [
        null,
        {subtype: 'V_CONTACT'},
        {subtype: 'SHOCK_CONTACT', troubles: ['something']},
        {subtype: 'MOTION_SENSOR'}
      ]
    };
  });
  describe('zones', () => {

    it('should filter null zones', () =>
      expect(component.zones).not.toContain(null)
    );
    it('should filter non contact zones', () =>
      expect(component.zones).not.toContain(jasmine.objectContaining({subtype: 'MOTION_SENSOR'}))
    );
    it('should retain contact sensors', () =>
      expect(component.zones).toContain(jasmine.objectContaining({subtype: 'V_CONTACT'}))
    );
  });
  describe('troubledZones', () => {
    it('should retain the troubled zones', () =>
      expect(component.troubledZones).toContain(jasmine.objectContaining({subtype: 'SHOCK_CONTACT'}))
    );
    it('should filter out untroubled zones', () =>
      expect(component.troubledZones).not.toContain(jasmine.objectContaining({subtype: 'V_CONTACT'}))
    );
  });
});
{'fraction_non_alphanumeric': 0.16380393799748638, 'fraction_numerical': 0.0, 'mean_word_length': 4.0062893081761, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, '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': '7134377', 'n_tokens_mistral': 755, 'n_tokens_neox': 740, 'n_words': 116}