Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
bioviz-js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Remi PLANEL
bioviz-js
Commits
4dc7d2ac
Commit
4dc7d2ac
authored
May 29, 2019
by
Remi PLANEL
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for d3 geneComponent
parent
7fea3e00
Pipeline
#12064
passed with stage
in 46 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
tests/gene.test.ts
tests/gene.test.ts
+41
-0
No files found.
tests/gene.test.ts
0 → 100644
View file @
4dc7d2ac
import
Gene
from
"
../src/scripts/component/sequence/gene
"
;
import
{
GeneData
}
from
"
../src/scripts/types
"
;
import
{
select
}
from
"
d3-selection
"
;
import
{
scaleLinear
}
from
"
d3-scale
"
;
describe
(
"
Test gene componennt
"
,
()
=>
{
const
result
=
'
<g class="gene" transform="translate(100,60)"><path style="fill-opacity: 0.85; stroke-width: 1px; stroke-opacity: 0.8;" transform="translate(0,35) translate(400,30) rotate(180)" d="M0,0L0,30L390,30L400,15L390,0Z"></path></g><g class="gene" transform="translate(600,60)"><path style="fill-opacity: 0.85; stroke-width: 1px; stroke-opacity: 0.8;" d="M0,0L0,30L390,30L400,15L390,0Z"></path></g>
'
;
document
.
body
.
innerHTML
=
'
<div><svg width="500"><g id="container"></g></svg></div>
'
;
const
data
:
GeneData
[]
=
[{
name
:
"
gene 1
"
,
strand
:
"
-
"
,
begin
:
10
,
end
:
50
,
gene
:
"
insA
"
,
},
{
name
:
"
gene 2
"
,
strand
:
"
+
"
,
begin
:
60
,
end
:
100
,
gene
:
"
yaaY
"
,
}];
const
geneComponent
=
Gene
();
const
xScale
=
scaleLinear
()
.
domain
([
0
,
120
])
.
range
([
0
,
1200
]);
test
(
"
test html generated by gene component
"
,
()
=>
{
const
container
=
select
(
"
svg
"
)
.
select
<
SVGGElement
>
(
"
g
"
);
container
.
datum
<
GeneData
[]
>
(
data
)
.
call
(
geneComponent
,
xScale
);
expect
(
container
.
html
()).
toBe
(
result
);
})
});
\ No newline at end of file
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