@@ -10,7 +10,7 @@ import {
1010 isValidInsert ,
1111 remove ,
1212 sclDocString ,
13- setAttribute ,
13+ setAttributes ,
1414 setTextContent ,
1515 testDocs ,
1616 UndoRedoTestCase ,
@@ -20,7 +20,7 @@ import {
2020
2121import { newEditEventV2 } from "./edit-event.js" ;
2222
23- import { EditV2 , isSetAttributes , isSetTextContent } from "./handleEdit .js" ;
23+ import { EditV2 , isSetAttributes , isSetTextContent } from "./editv2 .js" ;
2424
2525import { Editor } from "./Editor.js" ;
2626
@@ -42,7 +42,7 @@ describe("Utility function to handle EditV2 edits", () => {
4242 editor . dispatchEvent ( newEditEventV2 ( { parent, node, reference } , { } ) ) ;
4343 expect ( sclDoc . documentElement . querySelector ( "test" ) ) . to . have . property (
4444 "nextSibling" ,
45- reference
45+ reference ,
4646 ) ;
4747 } ) ;
4848
@@ -79,8 +79,8 @@ describe("Utility function to handle EditV2 edits", () => {
7979 } ,
8080 } ,
8181 } ,
82- { }
83- )
82+ { } ,
83+ ) ,
8484 ) ;
8585
8686 expect ( element . getAttribute ( "name" ) ) . to . equal ( "A2" ) ;
@@ -102,7 +102,7 @@ describe("Utility function to handle EditV2 edits", () => {
102102 newEditEventV2 ( {
103103 element,
104104 textContent : newTextContent ,
105- } )
105+ } ) ,
106106 ) ;
107107
108108 expect ( element . textContent ) . to . equal ( newTextContent ) ;
@@ -163,16 +163,16 @@ describe("Utility function to handle EditV2 edits", () => {
163163 { parent, node : node1 , reference } ,
164164 { parent, node : node2 , reference } ,
165165 ] ,
166- { }
167- )
166+ { } ,
167+ ) ,
168168 ) ;
169169 expect ( sclDoc . documentElement . querySelector ( "test1" ) ) . to . have . property (
170170 "nextSibling" ,
171- node2
171+ node2 ,
172172 ) ;
173173 expect ( sclDoc . documentElement . querySelector ( "test2" ) ) . to . have . property (
174174 "nextSibling" ,
175- reference
175+ reference ,
176176 ) ;
177177
178178 expect ( editor . docVersion ) . to . equal ( 1 ) ;
@@ -215,8 +215,8 @@ describe("Utility function to handle EditV2 edits", () => {
215215 edit . node . nextSibling === edit . reference
216216 ) ;
217217 return true ;
218- }
219- )
218+ } ,
219+ ) ,
220220 ) ) ;
221221
222222 it ( "set's an element's textContent on SetTextContent edit events" , ( ) =>
@@ -230,26 +230,26 @@ describe("Utility function to handle EditV2 edits", () => {
230230 editor . dispatchEvent ( newEditEventV2 ( edit ) ) ;
231231
232232 return edit . element . textContent === edit . textContent ;
233- }
234- )
233+ } ,
234+ ) ,
235235 ) ) ;
236236
237237 it ( "updates default- and foreign-namespace attributes on UpdateNS events" , ( ) =>
238238 assert (
239239 property (
240- testDocs . chain ( ( [ { nodes } ] ) => setAttribute ( nodes ) ) ,
240+ testDocs . chain ( ( [ { nodes } ] ) => setAttributes ( nodes ) ) ,
241241 ( edit ) => {
242242 editor . dispatchEvent ( newEditEventV2 ( edit ) ) ;
243243 return (
244244 Object . entries ( edit . attributes )
245245 . filter ( ( [ name ] ) => xmlAttributeName . test ( name ) )
246246 . map ( ( entry ) => entry as [ string , string | null ] )
247247 . every (
248- ( [ name , value ] ) => edit . element . getAttribute ( name ) === value
248+ ( [ name , value ] ) => edit . element . getAttribute ( name ) === value ,
249249 ) &&
250250 Object . entries ( edit . attributesNS )
251251 . map (
252- ( entry ) => entry as [ string , Record < string , string | null > ]
252+ ( entry ) => entry as [ string , Record < string , string | null > ] ,
253253 )
254254 . every ( ( [ ns , attributes ] ) =>
255255 Object . entries ( attributes )
@@ -261,13 +261,13 @@ describe("Utility function to handle EditV2 edits", () => {
261261 ns ,
262262 name . includes ( ":" )
263263 ? < string > name . split ( ":" , 2 ) [ 1 ]
264- : name
265- ) === value
266- )
264+ : name ,
265+ ) === value ,
266+ ) ,
267267 )
268268 ) ;
269- }
270- )
269+ } ,
270+ ) ,
271271 ) ) . timeout ( 20000 ) ;
272272
273273 it ( "removes elements on Remove edit events" , ( ) =>
@@ -277,8 +277,8 @@ describe("Utility function to handle EditV2 edits", () => {
277277 ( { node } ) => {
278278 editor . dispatchEvent ( newEditEventV2 ( { node } ) ) ;
279279 return ! node . parentNode ;
280- }
281- )
280+ } ,
281+ ) ,
282282 ) ) ;
283283
284284 it ( "undoes up to n edits on undo(n) call" , ( ) =>
@@ -287,21 +287,21 @@ describe("Utility function to handle EditV2 edits", () => {
287287 testDocs . chain ( ( docs ) => undoRedoTestCases ( ...docs ) ) ,
288288 ( { doc1, doc2, edits, squash } : UndoRedoTestCase ) => {
289289 const [ oldDoc1 , oldDoc2 ] = [ doc1 , doc2 ] . map ( ( doc ) =>
290- doc . cloneNode ( true )
290+ doc . cloneNode ( true ) ,
291291 ) ;
292292 edits . forEach ( ( a : EditV2 ) => {
293293 editor . dispatchEvent ( newEditEventV2 ( a , { squash } ) ) ;
294294 } ) ;
295295 if ( editor . editCount ) editor . undo ( editor . editCount ) ;
296296 expect ( doc1 ) . to . satisfy ( ( doc : XMLDocument ) =>
297- doc . isEqualNode ( oldDoc1 )
297+ doc . isEqualNode ( oldDoc1 ) ,
298298 ) ;
299299 expect ( doc2 ) . to . satisfy ( ( doc : XMLDocument ) =>
300- doc . isEqualNode ( oldDoc2 )
300+ doc . isEqualNode ( oldDoc2 ) ,
301301 ) ;
302302 return true ;
303- }
304- )
303+ } ,
304+ ) ,
305305 ) ) . timeout ( 20000 ) ;
306306
307307 it ( "redoes up to n edits on redo(n) call" , ( ) =>
@@ -313,19 +313,19 @@ describe("Utility function to handle EditV2 edits", () => {
313313 editor . dispatchEvent ( newEditEventV2 ( a ) ) ;
314314 } ) ;
315315 const [ oldDoc1 , oldDoc2 ] = [ doc1 , doc2 ] . map ( ( doc ) =>
316- new XMLSerializer ( ) . serializeToString ( doc )
316+ new XMLSerializer ( ) . serializeToString ( doc ) ,
317317 ) ;
318318
319319 if ( edits . length ) {
320320 editor . undo ( edits . length + 1 ) ;
321321 editor . redo ( edits . length + 1 ) ;
322322 }
323323 const [ newDoc1 , newDoc2 ] = [ doc1 , doc2 ] . map ( ( doc ) =>
324- new XMLSerializer ( ) . serializeToString ( doc )
324+ new XMLSerializer ( ) . serializeToString ( doc ) ,
325325 ) ;
326326 return oldDoc1 === newDoc1 && oldDoc2 === newDoc2 ;
327- }
328- )
327+ } ,
328+ ) ,
329329 ) ) . timeout ( 20000 ) ;
330330 } ) ;
331331} ) ;
0 commit comments