Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gy4443
chemotion_eln_server
Commits
4363a69e
Commit
4363a69e
authored
Sep 29, 2017
by
jasonych99
Browse files
Add Report Label - Spec
parent
6de89376
Changes
4
Show whitespace changes
Inline
Side-by-side
spec/api/report_api_spec.rb
View file @
4363a69e
...
...
@@ -148,6 +148,9 @@ describe Chemotion::ReportAPI do
{
\"
text
\"
:
\"
whole_diagram
\"
,
\"
checked
\"
:true}]"
,
imgFormat:
'png'
,
fileName:
fileName
,
molSerials:
"[{
\"
mol
\"
:{
\"
id
\"
:1,
\"
svgPath
\"
:
\"
1a.svg
\"
, \
\"
sumFormula
\"
:
\"
C6H6
\"
,
\"
iupacName
\"
:
\"
benzene
\"
}, \
\"
value
\"
:
\"
1a
\"
}]"
}
end
...
...
spec/javascripts/fixture/report.js
View file @
4363a69e
...
...
@@ -31,6 +31,7 @@ const originalState = {
activeKey
:
0
,
processings
:
[],
template
:
"
supporting_information
"
,
selMolSerials
:
[],
}
export
{
originalState
,
splSettings
,
rxnSettings
,
configs
}
spec/lib/report/docx/detail_reaction_spec.rb
View file @
4363a69e
...
...
@@ -73,8 +73,24 @@ describe 'Reporter::Docx::DetailReaction instance' do
ElementReportPermissionProxy
.
new
(
user
,
r1
,
[
user
.
id
]).
serialized
end
let!
(
:serial
)
{
'1a'
}
let!
(
:mol_serials
)
do
mol
=
s2
.
molecule
[
{
'mol'
=>
{
'id'
=>
mol
.
id
,
'svgPath'
=>
mol
.
molecule_svg_file
,
'sumFormula'
=>
mol
.
sum_formular
,
'iupacName'
=>
mol
.
iupac_name
},
'value'
=>
serial
}
]
end
let!
(
:target
)
do
Reporter
::
Docx
::
DetailReaction
.
new
(
reaction:
OpenStruct
.
new
(
r1_serialized
),
mol_serials:
mol_serials
,
index:
prev_index
)
end
...
...
@@ -132,11 +148,14 @@ describe 'Reporter::Docx::DetailReaction instance' do
[
{
"insert"
=>
"[4.
#{
prev_index
+
1
}
] "
},
{
"insert"
=>
"
#{
s2
.
molecule_name_hash
[
:label
]
}
"
},
{
"insert"
=>
" / "
},
{
"insert"
=>
" ("
},
{
"insert"
=>
serial
},
{
"insert"
=>
")"
},
{
"insert"
=>
", "
},
{
"insert"
=>
"
#{
s3
.
molecule_name_hash
[
:label
]
}
"
},
{
"insert"
=>
" ("
},
{
"attributes"
=>
{
"bold"
=>
"true"
},
"insert"
=>
"xx"
},
{
"insert"
=>
")"
}
{
"insert"
=>
serial
},
{
"insert"
=>
")"
}
,
]
)
expect
(
target
.
send
(
:products_delta
)).
to
eq
(
...
...
@@ -180,7 +199,7 @@ describe 'Reporter::Docx::DetailReaction instance' do
[
{
"insert"
=>
"
#{
tit
}
: "
},
{
"insert"
=>
"{A|"
},
{
"attributes"
=>
{
"bold"
=>
"true"
},
"insert"
=>
"xx"
},
{
"insert"
=>
serial
},
{
"insert"
=>
"} "
},
{
"insert"
=>
"
#{
s2
.
molecule_name_hash
[
:label
]
}
"
},
{
"insert"
=>
" (1.000 g, 55.508 mmol, 0.88 equiv.); "
},
...
...
@@ -190,11 +209,11 @@ describe 'Reporter::Docx::DetailReaction instance' do
{
"insert"
=>
" (0.00 mL); "
},
{
"insert"
=>
"Yield "
},
{
"insert"
=>
"{C|"
},
{
"attributes"
=>
{
"bold"
=>
"true"
},
"insert"
=>
"xx"
},
{
"insert"
=>
serial
},
{
"insert"
=>
"} =
#{
(
equiv
*
100
).
to_i
}
% (0.000 g, 0.000 mmol)"
},
{
"insert"
=>
"; "
},
{
"insert"
=>
"{D|"
},
{
"attributes"
=>
{
"bold"
=>
"true"
},
"insert"
=>
"xx"
},
{
"insert"
=>
serial
},
{
"insert"
=>
"} =
#{
(
equiv
*
100
).
to_i
}
% (0.000 g, 0.000 mmol)"
},
{
"insert"
=>
"."
},
{
"insert"
=>
"
\n
"
},
...
...
spec/models/sample_spec.rb
View file @
4363a69e
...
...
@@ -111,7 +111,7 @@ MOLFILE
let
(
:mol_attributes
){
{
"boiling_point"
=>
nil
,
"density"
=>
nil
,
"density"
=>
0.0
,
"inchikey"
=>
"XLYOFNOQVPJJNP-UHFFFAOYSA-N"
,
"inchistring"
=>
"InChI=1S/H2O/h1H2"
,
"iupac_name"
=>
"oxidane"
,
...
...
Write
Preview
Supports
Markdown
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