Skip to content
Snippets Groups Projects
Commit a4a3d495 authored by Angapay Divin's avatar Angapay Divin
Browse files

add test for instance => search => components

parent e25332d2
No related branches found
No related tags found
1 merge request!78Resolve "Tests client: Tester le module instance->search"
/**
* This file is part of Anis Client.
*
* @copyright Laboratoire d'Astrophysique de Marseille / CNRS
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { ComponentFixture, TestBed } from "@angular/core/testing";
import { AttributeLabelComponent } from "./attribute-label.component"
describe('[instance][search][components] AttributeLabelComponent', () => {
let component: AttributeLabelComponent;
let fixture: ComponentFixture<AttributeLabelComponent>;
TestBed.configureTestingModule({
declarations: [
AttributeLabelComponent
]
});
beforeEach(() => {
fixture = TestBed.createComponent(AttributeLabelComponent);
component = fixture.componentInstance;
});
it('should create component', () => {
expect(component).toBeTruthy();
})
})
\ No newline at end of file
/**
* This file is part of Anis Client.
*
* @copyright Laboratoire d'Astrophysique de Marseille / CNRS
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { ComponentFixture, TestBed } from "@angular/core/testing";
import { Attribute } from "src/app/metamodel/models";
import { Criterion } from "../../store/models";
import * as fromStoreModels from "../../store/models";
import { CriteriaListParametersComponent } from "./criteria-list-parameters.component"
describe('[instance][search][components] CriteriaListParametersComponent', () => {
let component: CriteriaListParametersComponent;
let fixture: ComponentFixture<CriteriaListParametersComponent>;
TestBed.configureTestingModule({
declarations: [
CriteriaListParametersComponent
]
});
beforeEach(() => {
fixture = TestBed.createComponent(CriteriaListParametersComponent);
component = fixture.componentInstance;
});
it('component should be created', () => {
expect(component).toBeTruthy();
});
it('getAttribute(2) should return attribute with id 2', () => {
let attribute: Attribute;
component.attributeList = [{ ...attribute, id: 1 }, { ...attribute, id: 2 }];
let result = component.getAttribute(2);
expect(result.id).toEqual(2);
});
it('printCriterion(criterion: Criterion) should call getPrettyCriterion(criterion)', () => {
let criterion: Criterion = { id: 1, type: 'test' };
let spy = jest.spyOn(fromStoreModels, 'getPrettyCriterion');
component.printCriterion(criterion);
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenCalledWith(criterion);
});
})
\ No newline at end of file
/**
* This file is part of Anis Client.
*
* @copyright Laboratoire d'Astrophysique de Marseille / CNRS
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import { dummiesComponents } from "./index"
describe('[instance][search][components] index', () => {
it('test index', () => {
expect(dummiesComponents.length).toEqual(8);
})
})
\ No newline at end of file
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