@@ -455,6 +455,58 @@ describe('Roundtrip', function() {
455455 } ) ;
456456
457457
458+ describe ( 'references (idAttr)' , function ( ) {
459+
460+ var refsModel = createModel ( [ 'properties' , 'properties-extended' ] ) ;
461+
462+
463+ it ( 'single (attribute / idAttr)' , async function ( ) {
464+
465+ // given
466+ var reader = new Reader ( refsModel ) ;
467+ var rootHandler = reader . handler ( 'props:Root' ) ;
468+
469+ var input =
470+ '<props:root xmlns:props="http://properties">' +
471+ '<props:containedCollection id="C_5">' +
472+ '<props:complex id="C_1" />' +
473+ '<props:complex id="C_2" />' +
474+ '</props:containedCollection>' +
475+ '<props:referencingNestedRef id="C_4">' +
476+ '<props:referencedComplex idref="C_1" />' +
477+ '</props:referencingNestedRef>' +
478+ '<props:referencingNestedRef id="C_6" referencedComplex="C_1" />' +
479+ '</props:root>' ;
480+
481+ var {
482+ rootElement
483+ } = await reader . fromXML ( input , rootHandler ) ;
484+
485+ // when
486+ var writer = createWriter ( refsModel ) ;
487+
488+ var output = writer . toXML ( rootElement ) ;
489+
490+ // then
491+ expect ( output ) . to . eql (
492+ '<props:root xmlns:props="http://properties">' +
493+ '<props:containedCollection id="C_5">' +
494+ '<props:complex id="C_1" />' +
495+ '<props:complex id="C_2" />' +
496+ '</props:containedCollection>' +
497+ '<props:referencingNestedRef id="C_4">' +
498+ '<props:referencedComplex idref="C_1" />' +
499+ '</props:referencingNestedRef>' +
500+ '<props:referencingNestedRef id="C_6">' +
501+ '<props:referencedComplex idref="C_1" />' +
502+ '</props:referencingNestedRef>' +
503+ '</props:root>'
504+ ) ;
505+ } ) ;
506+
507+ } ) ;
508+
509+
458510 describe ( 'package owned xml -> serialize property' , function ( ) {
459511
460512 it ( 'should roundtrip' , async function ( ) {
0 commit comments