Skip to content
Snippets Groups Projects
Commit dec5ead6 authored by Xiao Gui's avatar Xiao Gui
Browse files

fix json obj mutating bug

parent 6af81f43
No related branches found
No related tags found
No related merge requests found
......@@ -31,11 +31,14 @@ describe('templateCoordinatesTransformation.service.spec.ts', () => {
const service = TestBed.inject(TemplateCoordinatesTransformation)
const httpTestingController = TestBed.inject(HttpTestingController)
// subscriptions are necessary for http fetch to occur
service.getPointCoordinatesForTemplate(
'from',
'target',
[1,2,3]
)
).subscribe((_ev) => {
})
const req = httpTestingController.expectOne(service.url)
expect(req.request.method).toEqual('POST')
expect(
......
......@@ -14,10 +14,12 @@ import { HttpClientModule } from '@angular/common/http'
const bigbrainJson = require('!json-loader!src/res/ext/bigbrain.json')
const colinJson = require('!json-loader!src/res/ext/colin.json')
const colinJsonNehubaConfig = require('!json-loader!src/res/ext/colinNehubaConfig.json')
const reconstitutedColin = {
...colinJson,
nehubaConfig: colinJsonNehubaConfig
}
const reconstitutedColin = JSON.parse(JSON.stringify(
{
...colinJson,
nehubaConfig: colinJsonNehubaConfig
}
))
let returnPosition = null
@Injectable()
class MockCoordXformService{
......@@ -28,12 +30,12 @@ class MockCoordXformService{
}
}
const initialState = defaultRootState
defaultRootState.viewerState.fetchedTemplates = [
const initialState = JSON.parse(JSON.stringify( defaultRootState ))
initialState.viewerState.fetchedTemplates = [
bigbrainJson,
reconstitutedColin
]
initialState.viewerState.templateSelected = defaultRootState.viewerState.fetchedTemplates[0]
initialState.viewerState.templateSelected = initialState.viewerState.fetchedTemplates[0]
const currentNavigation = {
position: [4, 5, 6],
orientation: [0, 0, 0, 1],
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment