File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -167,4 +167,25 @@ describe("morphing operations", function () {
167167 ] ,
168168 ) ;
169169 } ) ;
170+
171+ it ( "Show SoftMatch aborting on two future soft matches" , function ( ) {
172+ // when nodes can't be softMatched because they have different types it will scan ahead
173+ // but it aborts the scan ahead if it finds two nodes ahead in both the new and old content
174+ // that softmatch so it can just insert the mis matched node it is on and get to the matching.
175+ assertOps (
176+ "<section><h1></h1><h2></h2><div></div></section>" ,
177+ "<section><div>Alert</div><h1></h1><h2></h2><div></div></section>" ,
178+ [
179+ [
180+ "Morphed" ,
181+ "<section><h1></h1><h2></h2><div></div></section>" ,
182+ "<section><div>Alert</div><h1></h1><h2></h2><div></div></section>" ,
183+ ] ,
184+ [ "Added" , "<div>Alert</div>" ] ,
185+ [ "Morphed" , "<h1></h1>" , "<h1></h1>" ] ,
186+ [ "Morphed" , "<h2></h2>" , "<h2></h2>" ] ,
187+ [ "Morphed" , "<div></div>" , "<div></div>" ] ,
188+ ] ,
189+ ) ;
190+ } ) ;
170191} ) ;
You can’t perform that action at this time.
0 commit comments