Commit 47fe20d1 authored by Thomas Letellier's avatar Thomas Letellier
Browse files

Improve xref test + refactoring. Fix GNP-5482.

parent 27da1e35
......@@ -3842,14 +3842,12 @@
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
......@@ -3869,8 +3867,7 @@
"concat-map": {
"version": "0.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"console-control-strings": {
"version": "1.1.0",
......@@ -4018,7 +4015,6 @@
"version": "3.0.4",
"bundled": true,
"dev": true,
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
}
......@@ -4026,8 +4022,7 @@
"minimist": {
"version": "0.0.8",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"minipass": {
"version": "2.3.5",
......@@ -4131,8 +4126,7 @@
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"dev": true,
"optional": true
"dev": true
},
"object-assign": {
"version": "4.1.1",
......@@ -6583,6 +6577,11 @@
"integrity": "sha512-MFh0d/Wa7vkKO3Y3LlacqAEeHK0mckVqzDieUKTT+KGxi+zIpeVsFxymkIiRpbpDziHc290Xr9A1O4Om7otoRA==",
"dev": true
},
"ng-mocks": {
"version": "7.6.0",
"resolved": "https://registry.npmjs.org/ng-mocks/-/ng-mocks-7.6.0.tgz",
"integrity": "sha512-Zorpd5I6KmvTtiYwcjymzCaortznMZr5CRB737XaNheITTUb2rVLUoEBk1dwQE3b/Cp5sByuS85fzwJRvjEXKQ=="
},
"ngx-moment": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/ngx-moment/-/ngx-moment-3.3.0.tgz",
......
......@@ -21,15 +21,16 @@
"@angular/platform-browser": "7.2.7",
"@angular/platform-browser-dynamic": "7.2.7",
"@angular/router": "7.2.7",
"@ng-bootstrap/ng-bootstrap": "4.0.0",
"@types/leaflet": "1.2.14",
"@types/leaflet.markercluster": "1.0.3",
"@ng-bootstrap/ng-bootstrap": "4.0.0",
"bootstrap": "4.1.3",
"core-js": "2.5.7",
"font-awesome": "4.7.0",
"moment": "2.24.0",
"leaflet": "1.3.4",
"leaflet.markercluster": "1.4.1",
"moment": "2.24.0",
"ng-mocks": "^7.6.0",
"ngx-moment": "3.3.0",
"popper.js": "1.14.6",
"rxjs": "6.4.0",
......
......@@ -19,16 +19,8 @@ import { Germplasm, GermplasmData, GermplasmResult, Institute, Origin, Site } fr
import { NgbPopoverModule } from '@ng-bootstrap/ng-bootstrap';
import { MomentModule } from 'ngx-moment';
import { LoadingSpinnerComponent } from '../loading-spinner/loading-spinner.component';
import { Component, Input } from '@angular/core';
@Component({
selector: 'gpds-xrefs',
template: '<br/>'
})
class MockXRefComponent {
@Input() xrefId: string;
}
import { MockComponent } from 'ng-mocks';
import { XrefsComponent } from '../xrefs/xrefs.component';
describe('GermplasmCardComponent', () => {
......@@ -85,7 +77,7 @@ describe('GermplasmCardComponent', () => {
};
const brapiGermplasmPedigree: GermplasmResult<BrapiGermplasmPedigree> = {
result : {
result: {
germplasmDbId: '12',
defaultDisplayName: '12',
pedigree: null,
......@@ -150,7 +142,7 @@ describe('GermplasmCardComponent', () => {
const brapiGermplasmAttributes: GermplasmResult<GermplasmData<BrapiGermplasmAttributes[]>> = {
result: {
data: [ {
data: [{
attributeName: 'longueur',
value: '30'
}]
......@@ -213,13 +205,14 @@ describe('GermplasmCardComponent', () => {
TestBed.configureTestingModule({
imports: [RouterTestingModule, NgbPopoverModule, MomentModule],
declarations: [
GermplasmCardComponent, LoadingSpinnerComponent, MockXRefComponent
GermplasmCardComponent, LoadingSpinnerComponent, MockComponent(XrefsComponent)
],
providers: [
// { provide: ActivatedRoute, useValue: activatedRoute },
{ provide: BrapiService, useValue: brapiService },
{ provide: GnpisService, useValue: gnpisService },
{ provide: ActivatedRoute,
{
provide: ActivatedRoute,
useValue: {
snapshot: {
queryParams: convertToParamMap({
......
......@@ -80,17 +80,7 @@
</ng-template>
</gpds-card-section>
<!--XRefs part -->
<gpds-xrefs [xrefId]="location.locationDbId"></gpds-xrefs>
</ng-container>
......@@ -10,15 +10,8 @@ import { CardRowComponent } from '../card-row/card-row.component';
import { LoadingSpinnerComponent } from '../loading-spinner/loading-spinner.component';
import { CardTableComponent } from '../card-table/card-table.component';
import { CardSectionComponent } from '../card-section/card-section.component';
import { Component, Input } from '@angular/core';
@Component({
selector: 'gpds-xrefs',
template: '<br/>'
})
class MockXRefComponent {
@Input() xrefId: string;
}
import { MockComponent } from 'ng-mocks';
import { XrefsComponent } from '../xrefs/xrefs.component';
describe('SiteCardComponent', () => {
......@@ -59,7 +52,7 @@ describe('SiteCardComponent', () => {
declarations: [
SiteCardComponent, MapComponent, LoadingSpinnerComponent,
CardRowComponent, CardSectionComponent, CardTableComponent,
MockXRefComponent
MockComponent(XrefsComponent)
],
providers: [
{ provide: BrapiService, useValue: brapiService },
......
......@@ -23,16 +23,8 @@ import { CardSectionComponent } from '../card-section/card-section.component';
import { CardRowComponent } from '../card-row/card-row.component';
import { LoadingSpinnerComponent } from '../loading-spinner/loading-spinner.component';
import { CardTableComponent } from '../card-table/card-table.component';
import { Component, Input } from '@angular/core';
@Component({
selector: 'gpds-xrefs',
template: '<br/>'
})
class MockXRefComponent {
@Input() xrefId: string;
}
import { MockComponent } from 'ng-mocks';
import { XrefsComponent } from '../xrefs/xrefs.component';
describe('StudyCardComponent', () => {
......@@ -215,7 +207,7 @@ describe('StudyCardComponent', () => {
imports: [RouterTestingModule],
declarations: [
StudyCardComponent, MapComponent, CardSectionComponent,
CardRowComponent, LoadingSpinnerComponent, CardTableComponent, MockXRefComponent
CardRowComponent, LoadingSpinnerComponent, CardTableComponent, MockComponent(XrefsComponent)
],
providers: [
{ provide: ActivatedRoute, useValue: activatedRoute },
......
......@@ -33,7 +33,8 @@ describe('XrefsComponent', () => {
const xref: XrefModel[] = [{
url: 'https://urgi.versailles.inra.fr/association/association/viewer.do#results/analysisIds=1808038',
description: 'Col-Fa-b*_MLM+Q+K is a GWAS analysis involving CC_Qualité panel',
description: 'Col-Fa-b*_MLM+Q+K is a GWASd anté paneCol-Fa-b*_MLM+Q+K is aGAS anlysis involving CC_Qualité' +
'djs dsqdsq djsqpodsjqodsqdsqkpdqpdWOLOLOLOOOOOOOsqpkdsqkdsqkdsqdsdsqdsqdsqddsqffjùsodfusjùfsfsd',
database_name: 'GnpIS',
entry_type: 'GWAS analysis',
db_version: 'GWAS_ANALYSIS_1808038_1'
......
......@@ -18,7 +18,6 @@ export class XrefsComponent implements OnInit {
ngOnInit() {
this.gnpisService.xref(this.xrefId).subscribe(
xrefs => {
console.log(xrefs);
this.xrefs = xrefs;
}
);
......
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