Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
3cd4e74a
Commit
3cd4e74a
authored
8 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
LayoutAlias throws errors insted logging them
parent
181a5fe6
No related branches found
No related tags found
1 merge request
!5
Frontend refactor
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend-js/src/main/js/map/data/LayoutAlias.js
+2
-2
2 additions, 2 deletions
frontend-js/src/main/js/map/data/LayoutAlias.js
frontend-js/src/test/js/map/data/LayoutAlias-test.js
+20
-19
20 additions, 19 deletions
frontend-js/src/test/js/map/data/LayoutAlias-test.js
with
22 additions
and
21 deletions
frontend-js/src/main/js/map/data/LayoutAlias.js
+
2
−
2
View file @
3cd4e74a
...
...
@@ -21,7 +21,7 @@ function LayoutAlias(javaObject) {
}
else
if
(
javaObject
.
type
===
LayoutAlias
.
GENERIC
)
{
this
.
setType
(
LayoutAlias
.
GENERIC
);
}
else
{
logger
.
e
rror
(
"
Unknown type:
"
,
javaObject
.
type
);
throw
new
E
rror
(
"
Unknown type:
"
,
javaObject
.
type
);
}
this
.
setGeneVariants
([]);
...
...
@@ -78,7 +78,7 @@ LayoutAlias.prototype.setGeneVariants = function(newGeneVariants) {
LayoutAlias
.
prototype
.
update
=
function
(
alias
)
{
if
(
!
(
alias
instanceof
LayoutAlias
))
{
logger
.
e
rror
(
"
Unknown paramter type:
"
+
alias
);
throw
new
E
rror
(
"
Unknown paramter type:
"
+
alias
);
return
;
}
...
...
This diff is collapsed.
Click to expand it.
frontend-js/src/test/js/map/data/LayoutAlias-test.js
+
20
−
19
View file @
3cd4e74a
"
use strict
"
;
var
Helper
=
require
(
'
../../Helper
'
);
require
(
"
../../mocha-config.js
"
);
var
LayoutAlias
=
require
(
'
../../../../main/js/map/data/LayoutAlias
'
);
var
assert
=
require
(
'
assert
'
);
var
logger
=
require
(
'
../../logger
'
);
describe
(
'
LayoutAlias
'
,
function
()
{
var
helper
;
beforeEach
(
function
()
{
logger
.
flushBuff
er
();
helper
=
new
Help
er
();
});
it
(
"
constructor
"
,
function
()
{
...
...
@@ -66,21 +71,13 @@ describe('LayoutAlias', function() {
});
it
(
"
invalid update
"
,
function
()
{
var
aliasId
=
908
;
var
val
=
0.2
;
var
colorVal
=
{
a
:
23
};
var
javaObj
=
{
idObject
:
aliasId
,
value
:
val
,
color
:
colorVal
,
geneVariations
:
[
{}
]
};
var
alias
=
new
LayoutAlias
(
javaObj
);
alias
.
update
(
"
invalid data
"
);
assert
.
equal
(
logger
.
getErrors
().
length
,
1
);
var
alias
=
helper
.
createLayoutAlias
();
try
{
alias
.
update
(
"
invalid data
"
);
assert
.
ok
(
false
);
}
catch
(
exception
)
{
assert
.
ok
(
exception
.
message
.
indexOf
(
"
Unknown paramter type
"
)
>=
0
);
}
});
...
...
@@ -127,8 +124,12 @@ describe('LayoutAlias', function() {
color
:
colorVal
,
type
:
"
some strange val
"
};
new
LayoutAlias
(
javaObj
);
assert
.
equal
(
logger
.
getErrors
().
length
,
1
);
try
{
new
LayoutAlias
(
javaObj
);
assert
.
ok
(
false
);
}
catch
(
exception
)
{
assert
.
ok
(
exception
.
message
.
indexOf
(
"
Unknown type
"
)
>=
0
);
}
});
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment