Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nrp-frontend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Neurorobotics Platform
nrp-frontend
Commits
5a067f51
Commit
5a067f51
authored
3 years ago
by
ManosAngelidis
Browse files
Options
Downloads
Patches
Plain Diff
[NRRPLT-8625] eslint and moving the test to the right folder
parent
2ab4754c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/services/models/__tests__/models-storage-service.test.js
+13
-13
13 additions, 13 deletions
src/services/models/__tests__/models-storage-service.test.js
src/services/models/models-storage-service.js
+0
-1
0 additions, 1 deletion
src/services/models/models-storage-service.js
with
13 additions
and
14 deletions
src/services/__tests__/models-storage-service.test.js
→
src/services/
models/
__tests__/models-storage-service.test.js
+
13
−
13
View file @
5a067f51
...
...
@@ -4,7 +4,7 @@
import
'
@testing-library/jest-dom
'
;
import
'
jest-fetch-mock
'
;
import
ModelsStorageService
from
'
../models
/models
-storage-service
'
;
import
ModelsStorageService
from
'
../models-storage-service
'
test
(
'
makes sure that invoking the constructor fails with the right message
'
,
()
=>
{
expect
(()
=>
{
...
...
@@ -23,24 +23,24 @@ test('the service instance always refers to the same object', () => {
test
(
'
getTemplateModels function
'
,
async
()
=>
{
let
modelsService
=
ModelsStorageService
.
instance
;
// fetch template robots
let
response
=
await
modelsService
.
getTemplateModels
(
true
,
'
robots
'
,
false
);
let
response
=
await
modelsService
.
getTemplateModels
(
true
,
'
robots
'
,
false
);
expect
(
response
.
name
).
toBe
(
'
hbp_clearpath_robotics_husky_a200
'
);
expect
(
response
.
ownerName
).
toBe
(
'
nrpuser
'
);
expect
(
response
.
type
).
toBe
(
'
robots
'
);
// fetch custom robots
response
=
await
modelsService
.
getTemplateModels
(
true
,
'
robots
'
,
true
);
response
=
await
modelsService
.
getTemplateModels
(
true
,
'
robots
'
,
true
);
expect
(
response
.
name
).
toBe
(
'
custom_hbp_clearpath_robotics_husky_a200
'
);
expect
(
response
.
ownerName
).
toBe
(
'
nrpuser
'
);
expect
(
response
.
type
).
toBe
(
'
robots
'
);
expect
(
response
.
type
).
toBe
(
'
robots
'
);
});
test
(
'
getCustomModelsByUser function
'
,
async
()
=>
{
let
modelsService
=
ModelsStorageService
.
instance
;
// fetch template robots
...
...
@@ -52,19 +52,19 @@ test('getCustomModelsByUser function', async () => {
});
test
(
'
verifyModelType function
'
,
async
()
=>
{
let
modelsService
=
ModelsStorageService
.
instance
;
const
expectedErrorPart
=
'
Error Type 400: Bad Request : The model type notRobots
'
;
const
expectedErrorPart
=
'
Error Type 400: Bad Request : The model type notRobots
'
;
// fetch template robots
expect
(()
=>
modelsService
.
verifyModelType
(
'
notRobots
'
)).
toThrowError
(
expectedErrorPart
);
expect
(()
=>
modelsService
.
verifyModelType
(
'
notRobots
'
)).
toThrowError
(
expectedErrorPart
);
});
test
(
'
setCustomModel function
'
,
async
()
=>
{
let
modelsService
=
ModelsStorageService
.
instance
;
let
response
=
await
modelsService
.
setCustomModel
(
'
robots
'
,
'
husky
'
,
'
fakeContent
'
);
let
response
=
await
modelsService
.
setCustomModel
(
'
robots
'
,
'
husky
'
,
'
fakeContent
'
);
expect
(
response
.
name
).
toBe
(
'
created_hbp_clearpath_robotics_husky_a200
'
);
expect
(
response
.
ownerName
).
toBe
(
'
nrpuser
'
);
expect
(
response
.
type
).
toBe
(
'
robots
'
);
expect
(
response
.
type
).
toBe
(
'
robots
'
);
});
This diff is collapsed.
Click to expand it.
src/services/models/models-storage-service.js
+
0
−
1
View file @
5a067f51
...
...
@@ -133,7 +133,6 @@ class ModelsStorageService extends HttpService {
try
{
this
.
verifyModelType
(
modelType
);
const
setCustomModelURL
=
`
${
storageModelsURL
}
/
${
modelType
}
/
${
modelName
}
`
;
console
.
log
(
setCustomModelURL
)
return
(
await
this
.
httpRequestPOST
(
setCustomModelURL
,
fileContent
)).
json
();
}
catch
(
error
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment