@@ -4,7 +4,7 @@ import { sampleTracingLayer } from "test/fixtures/dataset_server_object";
44import { initialState as defaultSkeletonState } from "test/fixtures/skeletontracing_object" ;
55import { chainReduce } from "test/helpers/chainReducer" ;
66import { withoutUpdateActiveItemTracing } from "test/helpers/saveHelpers" ;
7- import { applyActionsOnReadOnlyVersion } from "test/helpers/utils" ;
7+ import { transformStateAsReadOnly } from "test/helpers/utils" ;
88import type { Vector3 } from "viewer/constants" ;
99import {
1010 enforceSkeletonTracing ,
@@ -203,14 +203,12 @@ describe("Update Action Application for SkeletonTracing", () => {
203203 seenActionTypes . add ( action . name ) ;
204204 }
205205
206- const reappliedNewState = applyActionsOnReadOnlyVersion (
207- applyActions ,
208- state2WithoutActiveState ,
209- [
206+ const reappliedNewState = transformStateAsReadOnly ( state2WithoutActiveState , ( state ) =>
207+ applyActions ( state , [
210208 SkeletonTracingActions . applySkeletonUpdateActionsFromServerAction ( updateActions ) ,
211209 SkeletonTracingActions . setActiveNodeAction ( null ) ,
212210 setActiveUserBoundingBoxId ( null ) ,
213- ] ,
211+ ] ) ,
214212 ) ;
215213
216214 expect ( reappliedNewState ) . toEqual ( state3 ) ;
@@ -242,9 +240,11 @@ describe("Update Action Application for SkeletonTracing", () => {
242240 ) ,
243241 ) as ApplicableSkeletonUpdateAction [ ] ;
244242
245- const newState3 = applyActionsOnReadOnlyVersion ( applyActions , newState , [
246- SkeletonTracingActions . applySkeletonUpdateActionsFromServerAction ( updateActions ) ,
247- ] ) ;
243+ const newState3 = transformStateAsReadOnly ( newState , ( state ) =>
244+ applyActions ( state , [
245+ SkeletonTracingActions . applySkeletonUpdateActionsFromServerAction ( updateActions ) ,
246+ ] ) ,
247+ ) ;
248248
249249 const { activeNodeId } = enforceSkeletonTracing ( newState3 . annotation ) ;
250250 expect ( activeNodeId ) . toBeNull ( ) ;
@@ -273,9 +273,11 @@ describe("Update Action Application for SkeletonTracing", () => {
273273 ) ,
274274 ) as ApplicableSkeletonUpdateAction [ ] ;
275275
276- const newState3 = applyActionsOnReadOnlyVersion ( applyActions , newState , [
277- SkeletonTracingActions . applySkeletonUpdateActionsFromServerAction ( updateActions ) ,
278- ] ) ;
276+ const newState3 = transformStateAsReadOnly ( newState , ( state ) =>
277+ applyActions ( state , [
278+ SkeletonTracingActions . applySkeletonUpdateActionsFromServerAction ( updateActions ) ,
279+ ] ) ,
280+ ) ;
279281
280282 const { activeTreeId, activeNodeId } = enforceSkeletonTracing ( newState3 . annotation ) ;
281283
0 commit comments