@@ -70,9 +70,6 @@ describe("useDomGeometryCommits rollback", () => {
7070 }
7171
7272 act ( ( ) => root . render ( < Probe /> ) ) ;
73- await expect ( commits ! . handleDomPathOffsetCommit ( selection , { x : 50 , y : 60 } ) ) . rejects . toBe (
74- failure ,
75- ) ;
7673 await expect (
7774 commits ! . handleDomBoxSizeCommit ( selection , { width : 200 , height : 160 } , { x : 30 , y : 40 } ) ,
7875 ) . rejects . toBe ( failure ) ;
@@ -90,20 +87,6 @@ describe("useDomGeometryCommits read-only preview", () => {
9087 const selectionOn = ( element : HTMLElement ) =>
9188 ( { id : element . id , selector : `#${ element . id } ` , element } ) as unknown as DomEditSelection ;
9289
93- it ( "refuses a manual offset commit: no write, no history entry" , async ( ) => {
94- const element = document . createElement ( "div" ) ;
95- element . id = "ro-offset" ;
96- document . body . append ( element ) ;
97- applyStudioPathOffset ( element , { x : 1 , y : 2 } ) ;
98- const commitPositionPatchToHtml =
99- vi . fn < UseDomGeometryCommitsParams [ "commitPositionPatchToHtml" ] > ( ) ;
100- const { commits, unmount } = mountCommits ( commitPositionPatchToHtml , true ) ;
101- await commits ( ) . handleDomPathOffsetCommit ( selectionOn ( element ) , { x : 99 , y : 99 } ) ;
102- expect ( readStudioPathOffset ( element ) ) . toEqual ( { x : 1 , y : 2 } ) ;
103- expect ( commitPositionPatchToHtml ) . not . toHaveBeenCalled ( ) ;
104- unmount ( ) ;
105- } ) ;
106-
10790 it ( "refuses a manual box-size commit: no write, no history entry" , async ( ) => {
10891 const element = document . createElement ( "div" ) ;
10992 element . id = "ro-size" ;
@@ -131,19 +114,6 @@ describe("useDomGeometryCommits read-only preview", () => {
131114 expect ( commitPositionPatchToHtml ) . not . toHaveBeenCalled ( ) ;
132115 unmount ( ) ;
133116 } ) ;
134-
135- it ( "still commits an offset with the flag off" , async ( ) => {
136- const element = document . createElement ( "div" ) ;
137- element . id = "rw-offset" ;
138- document . body . append ( element ) ;
139- const commitPositionPatchToHtml = vi
140- . fn < UseDomGeometryCommitsParams [ "commitPositionPatchToHtml" ] > ( )
141- . mockResolvedValue ( undefined ) ;
142- const { commits, unmount } = mountCommits ( commitPositionPatchToHtml ) ;
143- await commits ( ) . handleDomPathOffsetCommit ( selectionOn ( element ) , { x : 5 , y : 6 } ) ;
144- expect ( commitPositionPatchToHtml ) . toHaveBeenCalledTimes ( 1 ) ;
145- unmount ( ) ;
146- } ) ;
147117} ) ;
148118
149119describe ( "useDomGeometryCommits element position offset" , ( ) => {
0 commit comments