Commit 2699b267 authored by Tifenn Guillas's avatar Tifenn Guillas
Browse files

Tests => DONE

parent 931bbb27
......@@ -2,7 +2,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { Component, Input, ViewChild } from '@angular/core';
import { DatasetListComponent } from './dataset-list.component';
import { Dataset, Family } from '../../../metamodel/model';
import { Dataset, Family, Project } from '../../../metamodel/model';
import { DATASET, DATASET_FAMILY_LIST } from '../../../../settings/test-data';
describe('[SearchMultiple][Datasets] Component: DatasetListComponent', () => {
......@@ -24,8 +24,9 @@ describe('[SearchMultiple][Datasets] Component: DatasetListComponent', () => {
}
@Component({ selector: 'app-datasets-by-family', template: '' })
class DatasetsByProjectStubComponent {
@Input() datasetFamily: number;
class DatasetsByFamilyStubComponent {
@Input() datasetFamily: Family;
@Input() projectList: Project[];
@Input() datasetList: Dataset[];
@Input() selectedDatasets: string[];
@Input() isAllSelected: boolean;
......@@ -41,7 +42,7 @@ describe('[SearchMultiple][Datasets] Component: DatasetListComponent', () => {
declarations: [
DatasetListComponent,
TestHostComponent,
DatasetsByProjectStubComponent
DatasetsByFamilyStubComponent
]
});
testHostFixture = TestBed.createComponent(TestHostComponent);
......
......@@ -2,7 +2,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing';
import { DatasetsByFamilyComponent } from './datasets-by-family.component';
import { Dataset } from '../../../metamodel/model';
import { DATASET_LIST } from '../../../../settings/test-data';
import { DATASET_LIST, PROJECT_LIST } from '../../../../settings/test-data';
describe('[SearchMultiple][Datasets] Component: DatasetsByFamilyComponent', () => {
let component: DatasetsByFamilyComponent;
......@@ -67,5 +67,10 @@ describe('[SearchMultiple][Datasets] Component: DatasetsByFamilyComponent', () =
component.updateSelectedDatasets.subscribe((event: string[]) => expect(event).toEqual(expectedSelectedDatasets));
component.unselectAll();
});
it('#getProjectDescription() should return the description of the given project', () => {
component.projectList = PROJECT_LIST;
expect(component.getProjectDescription('project_1')).toEqual('Description of project 1');
});
});
......@@ -58,7 +58,6 @@ export class DatasetsByFamilyComponent {
}
getProjectDescription(projectName: string): string {
console.error(this.projectList.find(p => p.name === projectName).description);
return this.projectList.find(p => p.name === projectName).description;
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment