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

bugfix: region position unit tests

parent d5ed63a1
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,6 @@ export class RegionBase { ...@@ -18,7 +18,6 @@ export class RegionBase {
private _position: [number, number, number] private _position: [number, number, number]
set position(val){ set position(val){
console.log('position', val)
if (verifyPositionArg(val)) { if (verifyPositionArg(val)) {
this._position = val this._position = val
} else { } else {
...@@ -35,6 +34,7 @@ export class RegionBase { ...@@ -35,6 +34,7 @@ export class RegionBase {
this._region = val this._region = val
this.region$.next(this._region) this.region$.next(this._region)
this.position = val?.position
// bug the centroid returned is currently nonsense // bug the centroid returned is currently nonsense
// this.position = val?.props?.centroid_mm // this.position = val?.props?.centroid_mm
if (!this._region) return if (!this._region) return
......
...@@ -266,7 +266,7 @@ describe('> viewerState.useEffect.ts', () => { ...@@ -266,7 +266,7 @@ describe('> viewerState.useEffect.ts', () => {
expect(ctrlUseEffect.navigateToRegion$).toBeObservable( expect(ctrlUseEffect.navigateToRegion$).toBeObservable(
hot('a', { hot('a', {
a: generalActionError({ a: generalActionError({
message: `${region.name} - does not have a position defined` message: `${region.name} has malformed position property: []`
}) })
}) })
) )
......
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