@@ -24,8 +24,8 @@ const insert: Insert = { parent: element, node: element, reference: null };
2424const remove : Remove = { node : element } ;
2525const setAttributes : SetAttributes = {
2626 element,
27- attributes : { name : 'value ' } ,
28- attributesNS : { namespaceURI : { name : 'value ' } } ,
27+ attributes : { attrName : 'attrValue ' } ,
28+ attributesNS : { myNamespaceURI : { attrName : 'attrValue ' } } ,
2929} ;
3030const setTextContent : SetTextContent = { element, textContent : '' } ;
3131
@@ -42,6 +42,24 @@ describe('isEditV2', () => {
4242 it ( 'returns true for SetAttributes' , ( ) =>
4343 expect ( setAttributes ) . to . satisfy ( isEditV2 ) ) ;
4444
45+ it ( 'SetAttributes returns false where Attributes are invalid' , ( ) =>
46+ expect ( {
47+ element,
48+ attributes : 'invalid attr object' ,
49+ } ) . to . not . satisfy ( isEditV2 ) ) ;
50+
51+ it ( 'SetAttributes returns false where NSAttributes are missing' , ( ) =>
52+ expect ( {
53+ element,
54+ attributesNS : null ,
55+ } ) . to . not . satisfy ( isEditV2 ) ) ;
56+
57+ it ( 'SetAttributes returns false if attr namespaced attr is not an object' , ( ) =>
58+ expect ( {
59+ element,
60+ attributesNS : { [ 1 ] : 'unacceptable' } ,
61+ } ) . to . not . satisfy ( isEditV2 ) ) ;
62+
4563 it ( 'returns true for SetTextContent' , ( ) =>
4664 expect ( setTextContent ) . to . satisfy ( isEditV2 ) ) ;
4765
0 commit comments