Commit 09374a1e authored by Jérémy Destin's avatar Jérémy Destin Committed by Célia Michotey
Browse files

fix: Fix test for germplasm card. Increase cyclomatic complexity due to new...

fix: Fix test for germplasm card. Increase cyclomatic complexity due to new elements on germplasm page. GNP-5490
parent a6db1694
......@@ -16,10 +16,9 @@ import {
BrapiGermplasmAttributes,
BrapiGermplasmPedigree,
BrapiGermplasmProgeny,
BrapiSet,
BrapiSibling
} from './models/brapi.germplasm.model';
import { Germplasm, GermplasmData, GermplasmResult, Institute, Origin, Site } from './models/gnpis.germplasm.model';
import { Germplasm, GermplasmData, GermplasmResult, GermplasmSet, Institute, Origin, Site } from './models/gnpis.germplasm.model';
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
import { TestBed } from '@angular/core/testing';
......@@ -212,7 +211,7 @@ describe('BrapiService', () => {
donationDate: null
};
const brapiSet: BrapiSet = {
const germplasmSet: GermplasmSet = {
germplasmCount: 12,
germplasmRef: null,
id: 12,
......@@ -272,9 +271,9 @@ describe('BrapiService', () => {
collector: origin,
breeder: origin,
distributors: [origin],
panel: [brapiSet],
collection: [brapiSet],
population: [brapiSet]
panel: [germplasmSet],
collection: [germplasmSet],
population: [germplasmSet]
};
const germplasmResultTest = {
......
......@@ -11,16 +11,16 @@ import {
BrapiDonor,
BrapiGermplasmAttributes,
BrapiGermplasmPedigree,
BrapiSet,
BrapiSibling
} from '../models/brapi.germplasm.model';
import { Germplasm, GermplasmData, GermplasmResult, Institute, Origin, Site } from '../models/gnpis.germplasm.model';
import { Germplasm, GermplasmData, GermplasmResult, GermplasmSet, Institute, Origin, Site } from '../models/gnpis.germplasm.model';
import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
import { MomentModule } from 'ngx-moment';
import { LoadingSpinnerComponent } from '../loading-spinner/loading-spinner.component';
import { CardSectionComponent } from '../card-section/card-section.component';
import { CardRowComponent } from '../card-row/card-row.component';
import { CardTableComponent } from '../card-table/card-table.component';
import { MapComponent } from '../map/map.component';
import { MockComponent } from 'ng-mocks';
import { XrefsComponent } from '../xrefs/xrefs.component';
......@@ -135,7 +135,7 @@ describe('GermplasmCardComponent', () => {
donationDate: null
};
const brapiSet: BrapiSet = {
const germplasmSet: GermplasmSet = {
germplasmCount: 12,
germplasmRef: null,
id: 12,
......@@ -195,9 +195,9 @@ describe('GermplasmCardComponent', () => {
collector: brapiOrigin,
breeder: brapiOrigin,
distributors: [brapiOrigin],
panel: [brapiSet],
collection: [brapiSet],
population: [brapiSet]
panel: [germplasmSet],
collection: [germplasmSet],
population: [germplasmSet]
};
beforeEach(async(() => {
......@@ -206,7 +206,7 @@ describe('GermplasmCardComponent', () => {
declarations: [
GermplasmCardComponent, LoadingSpinnerComponent, MockComponent(XrefsComponent)
GermplasmCardComponent, CardSectionComponent,
CardRowComponent, LoadingSpinnerComponent, CardTableComponent
CardRowComponent, LoadingSpinnerComponent, CardTableComponent, MapComponent
],
providers: [
{ provide: BrapiService, useValue: brapiService },
......@@ -241,10 +241,11 @@ describe('GermplasmCardComponent', () => {
expect(tester.title).toContainText('Germplasm: test');
expect(tester.cardHeader[0]).toContainText('Identification');
expect(tester.cardHeader[1]).toContainText('Holding');
expect(tester.cardHeader[2]).toContainText('Origin');
expect(tester.cardHeader[3]).toContainText('Distribution');
expect(tester.cardHeader[4]).toContainText('Genealogy');
expect(tester.cardHeader[5]).toContainText('Evaluation Data');
expect(tester.cardHeader[2]).toContainText('Collecting');
expect(tester.cardHeader[3]).toContainText('Breeder');
expect(tester.cardHeader[4]).toContainText('Donation');
expect(tester.cardHeader[5]).toContainText('Distribution');
expect(tester.cardHeader[6]).toContainText('Evaluation Data');
});
}));
});
......
import { Germplasm, Institute, Origin, Site } from './models/gnpis.germplasm.model';
import { Germplasm, GermplasmSet, Institute, Origin, Site } from './models/gnpis.germplasm.model';
import { BASE_URL, BASE_URL_GERMPLASM, GnpisService } from './gnpis.service';
import { BrapiMetaData, BrapiResults } from './models/brapi.model';
import { DataDiscoveryCriteria, DataDiscoverySource } from './models/data-discovery.model';
import { BrapiDescriptor, BrapiDonor, BrapiSet } from './models/brapi.germplasm.model';
import { BrapiDescriptor, BrapiDonor } from './models/brapi.germplasm.model';
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing';
import { TestBed } from '@angular/core/testing';
......@@ -29,7 +29,7 @@ describe('GnpisService', () => {
const site: Site = {
latitude: null,
longitude: null,
siteId: 1,
siteId: '1',
siteName: 'Nantes',
siteType: null
};
......@@ -71,7 +71,7 @@ describe('GnpisService', () => {
donationDate: null
};
const brapiSet: BrapiSet = {
const germplasmSet: GermplasmSet = {
germplasmCount: 12,
germplasmRef: null,
id: 12,
......@@ -122,9 +122,9 @@ describe('GnpisService', () => {
collector: brapiOrigin,
breeder: brapiOrigin,
distributors: [brapiOrigin],
panel: [brapiSet],
collection: [brapiSet],
population: [brapiSet]
panel: [germplasmSet],
collection: [germplasmSet],
population: [germplasmSet]
};
let gnpisService: GnpisService;
......
......@@ -15,7 +15,7 @@
],
"template-cyclomatic-complexity": [
true,
12
18
]
}
}
Markdown is supported
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