Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Remi PLANEL
bioviz-js
Commits
49cb2080
Commit
49cb2080
authored
May 29, 2019
by
Remi PLANEL
Browse files
Add test for gene-shapes
parent
f924801f
Pipeline
#12061
passed with stage
in 57 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
tests/gene-shapes.test.ts
0 → 100644
View file @
49cb2080
import
{
arrowShape
}
from
"
../src/scripts/component/sequence/gene-shapes
"
;
import
{
scaleLinear
}
from
"
d3-scale
"
;
import
{
GeneData
}
from
"
../src/scripts/types
"
;
import
linearGene
from
"
../src/scripts/layout/linear-gene
"
;
import
{
line
}
from
"
d3
"
;
describe
(
"
Test gene shapes
"
,
()
=>
{
const
data
:
GeneData
[]
=
[{
name
:
"
gene 1
"
,
strand
:
"
-
"
,
begin
:
10
,
end
:
50
,
gene
:
"
insA
"
,
},
{
name
:
"
gene 2
"
,
strand
:
"
+
"
,
begin
:
60
,
end
:
90
,
gene
:
"
yaaY
"
,
},
{
name
:
"
gene 3
"
,
strand
:
"
+
"
,
begin
:
200
,
end
:
228
,
gene
:
"
bioB
"
,
},
];
const
pathResults
=
[
"
M0,0L0,50L190,50L200,25L190,0Z
"
,
"
M0,0L0,50L140,50L150,25L140,0Z
"
,
"
M0,0L0,50L130,50L140,25L130,0Z
"
];
const
xScale
=
scaleLinear
()
.
domain
([
0
,
250
])
.
range
([
0
,
1250
]);
const
linearGeneWithPostion
=
linearGene
(
data
,
xScale
);
const
testsWithResults
=
linearGeneWithPostion
.
map
((
genePostition
,
i
)
=>
{
return
[
arrowShape
(
genePostition
,
50
),
pathResults
[
i
]];
})
testsWithResults
.
forEach
(([
res
,
expected
],
i
)
=>
{
test
(
"
Test Arrow Shape gene
"
+
i
,
()
=>
{
expect
(
res
).
toBe
(
expected
);
});
});
});
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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