Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
urgi-is
FAIDARE
Commits
01c08dbe
Commit
01c08dbe
authored
Nov 26, 2019
by
Jérémy Destin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: Work on tests.
GNP-5097
parent
ca68cb76
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
7 deletions
+39
-7
frontend/src/app/genealogic-tree/genealogic-tree.component.spec.ts
...src/app/genealogic-tree/genealogic-tree.component.spec.ts
+28
-4
frontend/src/app/genealogic-tree/genealogic-tree.component.ts
...tend/src/app/genealogic-tree/genealogic-tree.component.ts
+8
-0
frontend/src/app/germplasm-card/germplasm-card.component.spec.ts
...d/src/app/germplasm-card/germplasm-card.component.spec.ts
+3
-3
No files found.
frontend/src/app/genealogic-tree/genealogic-tree.component.spec.ts
View file @
01c08dbe
import
{
async
,
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
ComponentFixture
,
TestBed
}
from
'
@angular/core/testing
'
;
import
{
GenealogicTreeComponent
}
from
'
./genealogic-tree.component
'
;
import
{
GenealogicTreeComponent
,
GenealogicTreeFactory
}
from
'
./genealogic-tree.component
'
;
import
{
CropOntologyWidgetFactory
}
from
'
../form/trait-ontology-widget/trait-ontology-widget.component
'
;
describe
(
'
GenealogicTreeComponent
'
,
()
=>
{
let
component
:
GenealogicTreeComponent
;
let
fixture
:
ComponentFixture
<
GenealogicTreeComponent
>
;
// TODO create complete GenealogicTreeobject
const
fakeGenealogicTree
=
{};
beforeEach
(
async
(()
=>
{
/*
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [GenealogicTreeComponent]
})
...
...
@@ -17,9 +23,27 @@ describe('GenealogicTreeComponent', () => {
fixture = TestBed.createComponent(GenealogicTreeComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
});*/
const
fakeFactory
:
GenealogicTreeFactory
=
{
initialize
()
{
return
fakeGenealogicTree
;
}
};
beforeEach
(()
=>
TestBed
.
configureTestingModule
({
declarations
:
[
GenealogicTreeComponent
],
providers
:
[
{
provide
:
GenealogicTreeComponent
,
useValue
:
fakeFactory
}
]
}));
it
(
'
should create
'
,
()
=>
{
const
fixture
=
TestBed
.
createComponent
(
GenealogicTreeComponent
);
const
component
=
fixture
.
componentInstance
;
fixture
.
detectChanges
();
expect
(
component
).
toBeTruthy
();
});
});
...
...
frontend/src/app/genealogic-tree/genealogic-tree.component.ts
View file @
01c08dbe
import
{
Component
,
Input
,
OnInit
}
from
'
@angular/core
'
;
import
BrAPI
from
'
@solgenomics/brapijs
'
;
import
PedigreeViewer
from
'
@solgenomics/brapi-pedigree-viewer
'
;
import
GenealogicTree
from
'
@solgenomics/brapi-pedigree-viewer/build/PedigreeViewer.js
'
export
class
GenealogicTreeFactory
{
initialize
(...
args
):
GenealogicTree
{
return
new
GenealogicTree
(...
args
);
}
}
@
Component
({
selector
:
'
faidare-genealogic-tree
'
,
...
...
frontend/src/app/germplasm-card/germplasm-card.component.spec.ts
View file @
01c08dbe
...
...
@@ -17,7 +17,7 @@ import { MapComponent } from '../map/map.component';
import
{
BrapiGermplasmAttributes
,
BrapiGermplasmPedigree
,
BrapiResult
,
BrapiSibling
}
from
'
../models/brapi.model
'
;
import
{
Donor
,
Germplasm
,
GermplasmInstitute
,
GermplasmSet
,
Institute
,
Site
}
from
'
../models/gnpis.model
'
;
import
{
DataDiscoverySource
}
from
'
../models/data-discovery.model
'
;
import
{
MockComponent
}
from
'
ng-mocks
'
;
import
{
MockComponent
,
MockComponents
}
from
'
ng-mocks
'
;
import
{
XrefsComponent
}
from
'
../xrefs/xrefs.component
'
;
import
{
CardGenericDocumentComponent
}
from
'
../card-generic-document/card-generic-document.component
'
;
import
{
GenealogicTreeComponent
}
from
'
../genealogic-tree/genealogic-tree.component
'
;
...
...
@@ -225,9 +225,9 @@ describe('GermplasmCardComponent', () => {
TestBed
.
configureTestingModule
({
imports
:
[
RouterTestingModule
,
NgbPopoverModule
,
MomentModule
],
declarations
:
[
GermplasmCardComponent
,
LoadingSpinnerComponent
,
MockComponent
(
XrefsComponent
),
CardSectionComponent
,
GermplasmCardComponent
,
LoadingSpinnerComponent
,
MockComponent
s
(
XrefsComponent
),
CardSectionComponent
,
CardRowComponent
,
LoadingSpinnerComponent
,
CardTableComponent
,
MapComponent
,
MockComponent
(
CardGenericDocumentComponent
),
MockComponent
(
GenealogicTreeComponent
)
MapComponent
,
MockComponent
s
(
CardGenericDocumentComponent
),
MockComponent
s
(
GenealogicTreeComponent
)
],
providers
:
[
{
provide
:
BrapiService
,
useValue
:
brapiService
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment