Skip to content
Snippets Groups Projects
Commit dad7b891 authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Merge branch '5-add-tests-for-instance-search-module' into 'develop'

Clean code

Closes #5

See merge request !20
parents 063d8b9b 8a52e2b5
No related branches found
No related tags found
2 merge requests!29Develop,!20Clean code
Pipeline #6729 passed
Pipeline: anis-next

#6730

    ......@@ -2,8 +2,6 @@ import { Component, ViewChild } from '@angular/core';
    import { ComponentFixture, TestBed } from '@angular/core/testing';
    import { FormArray, FormsModule, ReactiveFormsModule } from '@angular/forms';
    import { NgSelectModule } from '@ng-select/ng-select';
    import { CheckboxComponent } from './checkbox.component';
    import { SelectMultipleCriterion } from '../../../../store/models/criterion';
    import { Option } from '../../../../../metamodel/models';
    ......@@ -14,7 +12,7 @@ describe('[Instance][Search][Component][Criteria][SearchType] CheckboxComponent'
    @Component({
    selector: `app-host`,
    template: `
    <app-checkbox
    <app-checkbox
    [id]="id"
    [label]="label"
    [options]="options"
    ......@@ -41,7 +39,6 @@ describe('[Instance][Search][Component][Criteria][SearchType] CheckboxComponent'
    TestHostComponent
    ],
    imports: [
    // NgSelectModule,
    FormsModule,
    ReactiveFormsModule
    ]
    ......@@ -56,18 +53,18 @@ describe('[Instance][Search][Component][Criteria][SearchType] CheckboxComponent'
    expect(testedComponent).toBeTruthy();
    });
    it.only('should execute ngOnInit lifecycle', () => {
    testedComponent.options = [
    { label: 'One', value: 'one', display: 1 },
    { label: 'Two', value: 'two', display: 2 },
    { label: 'Three', value: 'three', display: 3 }
    ];
    testedComponent.ngOnInit();
    console.log(testedComponent.options.length);
    const formArray = testedComponent.form.controls.checkboxes as FormArray;
    // console.log(formArray.controls[0]);
    expect(testedComponent).toBeTruthy();
    });
    // it('should execute ngOnInit lifecycle', () => {
    // testedComponent.options = [
    // { label: 'One', value: 'one', display: 1 },
    // { label: 'Two', value: 'two', display: 2 },
    // { label: 'Three', value: 'three', display: 3 }
    // ];
    // testedComponent.ngOnInit();
    // console.log(testedComponent.options.length);
    // const formArray = testedComponent.form.controls.checkboxes as FormArray;
    // // console.log(formArray.controls[0]);
    // expect(testedComponent).toBeTruthy();
    // });
    // it('should call ngOnChanges and apply changes', () => {
    // const spy = jest.spyOn(testedComponent, 'ngOnChanges');
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment