|
@@ -97,10 +97,10 @@ describe( 'View converter builder', () => {
|
|
|
it( 'should convert from view element to model element', () => {
|
|
it( 'should convert from view element to model element', () => {
|
|
|
buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
|
|
buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( new ViewContainerElement( 'p', null, new ViewText( 'foo' ) ), objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ const { conversionResult } = dispatcher.convert( new ViewContainerElement( 'p', null, new ViewText( 'foo' ) ), objWithContext );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) ).to.equal( '<paragraph>foo</paragraph>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<paragraph>foo</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert from view element to model element using creator function', () => {
|
|
it( 'should convert from view element to model element using creator function', () => {
|
|
@@ -108,17 +108,19 @@ describe( 'View converter builder', () => {
|
|
|
.fromElement( 'img' )
|
|
.fromElement( 'img' )
|
|
|
.toElement( ( viewElement ) => new ModelElement( 'image', { src: viewElement.getAttribute( 'src' ) } ) );
|
|
.toElement( ( viewElement ) => new ModelElement( 'image', { src: viewElement.getAttribute( 'src' ) } ) );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( new ViewContainerElement( 'img', { src: 'foo.jpg' } ), objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ const { conversionResult } = dispatcher.convert( new ViewContainerElement( 'img', { src: 'foo.jpg' } ), objWithContext );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) ).to.equal( '<image src="foo.jpg"></image>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<image src="foo.jpg"></image>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert from view element to model attribute', () => {
|
|
it( 'should convert from view element to model attribute', () => {
|
|
|
buildViewConverter().for( dispatcher ).fromElement( 'strong' ).toAttribute( 'bold', true );
|
|
buildViewConverter().for( dispatcher ).fromElement( 'strong' ).toAttribute( 'bold', true );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( new ViewAttributeElement( 'strong', null, new ViewText( 'foo' ) ), objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ const { conversionResult } = dispatcher.convert(
|
|
|
|
|
+ new ViewAttributeElement( 'strong', null, new ViewText( 'foo' ) ), objWithContext
|
|
|
|
|
+ );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
// Have to check root because result is a ModelText.
|
|
// Have to check root because result is a ModelText.
|
|
|
expect( modelToString( modelRoot ) ).to.equal( '<$root><$text bold="true">foo</$text></$root>' );
|
|
expect( modelToString( modelRoot ) ).to.equal( '<$root><$text bold="true">foo</$text></$root>' );
|
|
@@ -129,8 +131,10 @@ describe( 'View converter builder', () => {
|
|
|
.fromElement( 'a' )
|
|
.fromElement( 'a' )
|
|
|
.toAttribute( ( viewElement ) => ( { key: 'linkHref', value: viewElement.getAttribute( 'href' ) } ) );
|
|
.toAttribute( ( viewElement ) => ( { key: 'linkHref', value: viewElement.getAttribute( 'href' ) } ) );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( new ViewAttributeElement( 'a', { href: 'foo.html' }, new ViewText( 'foo' ) ), objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ const { conversionResult } = dispatcher.convert(
|
|
|
|
|
+ new ViewAttributeElement( 'a', { href: 'foo.html' }, new ViewText( 'foo' ) ), objWithContext
|
|
|
|
|
+ );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
// Have to check root because result is a ModelText.
|
|
// Have to check root because result is a ModelText.
|
|
|
expect( modelToString( modelRoot ) ).to.equal( '<$root><$text linkHref="foo.html">foo</$text></$root>' );
|
|
expect( modelToString( modelRoot ) ).to.equal( '<$root><$text linkHref="foo.html">foo</$text></$root>' );
|
|
@@ -143,10 +147,12 @@ describe( 'View converter builder', () => {
|
|
|
.fromAttribute( 'class' )
|
|
.fromAttribute( 'class' )
|
|
|
.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
|
|
.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( new ViewContainerElement( 'p', { class: 'myClass' }, new ViewText( 'foo' ) ), objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ const { conversionResult } = dispatcher.convert(
|
|
|
|
|
+ new ViewContainerElement( 'p', { class: 'myClass' }, new ViewText( 'foo' ) ), objWithContext
|
|
|
|
|
+ );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) ).to.equal( '<paragraph class="myClass">foo</paragraph>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<paragraph class="myClass">foo</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert from view attribute and key to model attribute', () => {
|
|
it( 'should convert from view attribute and key to model attribute', () => {
|
|
@@ -161,9 +167,9 @@ describe( 'View converter builder', () => {
|
|
|
new ViewContainerElement( 'p', { class: 'important theme-nice' }, new ViewText( 'bar' ) )
|
|
new ViewContainerElement( 'p', { class: 'important theme-nice' }, new ViewText( 'bar' ) )
|
|
|
] );
|
|
] );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( viewStructure, objWithContext );
|
|
|
|
|
|
|
+ const { conversionResult } = dispatcher.convert( viewStructure, objWithContext );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) )
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) )
|
|
|
.to.equal( '<paragraph important="true">foo</paragraph><paragraph important="true" theme="nice">bar</paragraph>' );
|
|
.to.equal( '<paragraph important="true">foo</paragraph><paragraph important="true" theme="nice">bar</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
@@ -184,10 +190,10 @@ describe( 'View converter builder', () => {
|
|
|
new ViewContainerElement( 'span', { style: 'font-weight:bold; font-size:20px' }, new ViewText( 'ddd' ) )
|
|
new ViewContainerElement( 'span', { style: 'font-weight:bold; font-size:20px' }, new ViewText( 'ddd' ) )
|
|
|
] );
|
|
] );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ const { conversionResult } = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) ).to.equal( '<paragraph><$text bold="true">aaabbbcccddd</$text></paragraph>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<paragraph><$text bold="true">aaabbbcccddd</$text></paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert from pattern to marker', () => {
|
|
it( 'should convert from pattern to marker', () => {
|
|
@@ -195,10 +201,10 @@ describe( 'View converter builder', () => {
|
|
|
|
|
|
|
|
const viewElement = new ViewAttributeElement( 'span', { 'data-name': 'search' } );
|
|
const viewElement = new ViewAttributeElement( 'span', { 'data-name': 'search' } );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ const { conversionResult } = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) ).to.equal( '<$marker data-name="search"></$marker>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<$marker data-name="search"></$marker>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert from element to marker using creator function', () => {
|
|
it( 'should convert from element to marker using creator function', () => {
|
|
@@ -208,10 +214,10 @@ describe( 'View converter builder', () => {
|
|
|
|
|
|
|
|
const element = new ViewAttributeElement( 'marker', { class: 'search' } );
|
|
const element = new ViewAttributeElement( 'marker', { class: 'search' } );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( element, objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ const { conversionResult } = dispatcher.convert( element, objWithContext );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) ).to.equal( '<$marker data-name="search"></$marker>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<$marker data-name="search"></$marker>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert from multiple view entities to marker', () => {
|
|
it( 'should convert from multiple view entities to marker', () => {
|
|
@@ -229,14 +235,14 @@ describe( 'View converter builder', () => {
|
|
|
new ViewAttributeElement( 'span', { 'foo': 'marker', 'bar': 'marker', 'data-name': 'marker3' } )
|
|
new ViewAttributeElement( 'span', { 'foo': 'marker', 'bar': 'marker', 'data-name': 'marker3' } )
|
|
|
] );
|
|
] );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ const { conversionResult, markersData } = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) ).to.equal(
|
|
|
|
|
- '<paragraph>' +
|
|
|
|
|
- '<$marker data-name="marker1"></$marker><$marker data-name="marker2"></$marker><$marker data-name="marker3"></$marker>' +
|
|
|
|
|
- '</paragraph>'
|
|
|
|
|
- );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<paragraph></paragraph>' );
|
|
|
|
|
+
|
|
|
|
|
+ expect( markersData.size ).to.equal( 3 );
|
|
|
|
|
+ expect( markersData.has( 'marker1' ) ).to.true;
|
|
|
|
|
+ expect( markersData.has( 'marker2' ) ).to.true;
|
|
|
|
|
+ expect( markersData.has( 'marker3' ) ).to.true;
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should do nothing when there is no element matching to marker pattern', () => {
|
|
it( 'should do nothing when there is no element matching to marker pattern', () => {
|
|
@@ -244,7 +250,7 @@ describe( 'View converter builder', () => {
|
|
|
|
|
|
|
|
const element = new ViewAttributeElement( 'span' );
|
|
const element = new ViewAttributeElement( 'span' );
|
|
|
|
|
|
|
|
- expect( dispatcher.convert( element, objWithContext ) ).to.null;
|
|
|
|
|
|
|
+ expect( dispatcher.convert( element, objWithContext ).conversionResult ).to.null;
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should throw an error when view element in not valid to convert to marker', () => {
|
|
it( 'should throw an error when view element in not valid to convert to marker', () => {
|
|
@@ -293,7 +299,9 @@ describe( 'View converter builder', () => {
|
|
|
let result;
|
|
let result;
|
|
|
|
|
|
|
|
// Not quite megatron.
|
|
// Not quite megatron.
|
|
|
- result = dispatcher.convert( new ViewContainerElement( 'span', { class: 'megatron' }, new ViewText( 'foo' ) ), objWithContext );
|
|
|
|
|
|
|
+ result = dispatcher.convert(
|
|
|
|
|
+ new ViewContainerElement( 'span', { class: 'megatron' }, new ViewText( 'foo' ) ), objWithContext
|
|
|
|
|
+ ).conversionResult;
|
|
|
modelRoot.appendChildren( result );
|
|
modelRoot.appendChildren( result );
|
|
|
expect( modelToString( result ) ).to.equal( '<span>foo</span>' );
|
|
expect( modelToString( result ) ).to.equal( '<span>foo</span>' );
|
|
|
|
|
|
|
@@ -301,7 +309,7 @@ describe( 'View converter builder', () => {
|
|
|
result = dispatcher.convert(
|
|
result = dispatcher.convert(
|
|
|
new ViewContainerElement( 'span', { class: 'megatron', body: 'megatron', legs: 'megatron' }, new ViewText( 'foo' ) ),
|
|
new ViewContainerElement( 'span', { class: 'megatron', body: 'megatron', legs: 'megatron' }, new ViewText( 'foo' ) ),
|
|
|
objWithContext
|
|
objWithContext
|
|
|
- );
|
|
|
|
|
|
|
+ ).conversionResult;
|
|
|
|
|
|
|
|
modelRoot.appendChildren( result );
|
|
modelRoot.appendChildren( result );
|
|
|
expect( modelToString( result ) ).to.equal( '<span>foo</span>' );
|
|
expect( modelToString( result ) ).to.equal( '<span>foo</span>' );
|
|
@@ -314,7 +322,7 @@ describe( 'View converter builder', () => {
|
|
|
new ViewText( 'foo' )
|
|
new ViewText( 'foo' )
|
|
|
),
|
|
),
|
|
|
objWithContext
|
|
objWithContext
|
|
|
- );
|
|
|
|
|
|
|
+ ).conversionResult;
|
|
|
|
|
|
|
|
modelRoot.appendChildren( result );
|
|
modelRoot.appendChildren( result );
|
|
|
expect( modelToString( result ) ).to.equal( '<paragraph>foo</paragraph>' );
|
|
expect( modelToString( result ) ).to.equal( '<paragraph>foo</paragraph>' );
|
|
@@ -327,7 +335,7 @@ describe( 'View converter builder', () => {
|
|
|
new ViewText( 'foo' )
|
|
new ViewText( 'foo' )
|
|
|
),
|
|
),
|
|
|
objWithContext
|
|
objWithContext
|
|
|
- );
|
|
|
|
|
|
|
+ ).conversionResult;
|
|
|
|
|
|
|
|
modelRoot.appendChildren( result );
|
|
modelRoot.appendChildren( result );
|
|
|
expect( modelToString( result ) ).to.equal( '<MEGATRON>foo</MEGATRON>' );
|
|
expect( modelToString( result ) ).to.equal( '<MEGATRON>foo</MEGATRON>' );
|
|
@@ -347,10 +355,10 @@ describe( 'View converter builder', () => {
|
|
|
new ViewText( 'foo' )
|
|
new ViewText( 'foo' )
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- let result = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
|
|
+ let { conversionResult } = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
- expect( modelToString( result ) ).to.equal( '<span transformer="megatron">foo</span>' );
|
|
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<span transformer="megatron">foo</span>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should set different priorities for `toElement` and `toAttribute` conversion', () => {
|
|
it( 'should set different priorities for `toElement` and `toAttribute` conversion', () => {
|
|
@@ -359,11 +367,13 @@ describe( 'View converter builder', () => {
|
|
|
.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
|
|
.toAttribute( ( viewElement ) => ( { key: 'class', value: viewElement.getAttribute( 'class' ) } ) );
|
|
|
buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
|
|
buildViewConverter().for( dispatcher ).fromElement( 'p' ).toElement( 'paragraph' );
|
|
|
|
|
|
|
|
- let result = dispatcher.convert( new ViewContainerElement( 'p', { class: 'myClass' }, new ViewText( 'foo' ) ), objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ let { conversionResult } = dispatcher.convert(
|
|
|
|
|
+ new ViewContainerElement( 'p', { class: 'myClass' }, new ViewText( 'foo' ) ), objWithContext
|
|
|
|
|
+ );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
// Element converter was fired first even though attribute converter was added first.
|
|
// Element converter was fired first even though attribute converter was added first.
|
|
|
- expect( modelToString( result ) ).to.equal( '<paragraph class="myClass">foo</paragraph>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<paragraph class="myClass">foo</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should overwrite default priorities for converters', () => {
|
|
it( 'should overwrite default priorities for converters', () => {
|
|
@@ -374,7 +384,9 @@ describe( 'View converter builder', () => {
|
|
|
|
|
|
|
|
let result;
|
|
let result;
|
|
|
|
|
|
|
|
- result = dispatcher.convert( new ViewContainerElement( 'p', { class: 'myClass' }, new ViewText( 'foo' ) ), objWithContext );
|
|
|
|
|
|
|
+ result = dispatcher.convert(
|
|
|
|
|
+ new ViewContainerElement( 'p', { class: 'myClass' }, new ViewText( 'foo' ) ), objWithContext
|
|
|
|
|
+ ).conversionResult;
|
|
|
modelRoot.appendChildren( result );
|
|
modelRoot.appendChildren( result );
|
|
|
expect( modelToString( result ) ).to.equal( '<paragraph class="myClass">foo</paragraph>' );
|
|
expect( modelToString( result ) ).to.equal( '<paragraph class="myClass">foo</paragraph>' );
|
|
|
|
|
|
|
@@ -382,7 +394,9 @@ describe( 'View converter builder', () => {
|
|
|
.from( { name: 'p', class: 'myClass' } ).withPriority( 'high' )
|
|
.from( { name: 'p', class: 'myClass' } ).withPriority( 'high' )
|
|
|
.toElement( 'customP' );
|
|
.toElement( 'customP' );
|
|
|
|
|
|
|
|
- result = dispatcher.convert( new ViewContainerElement( 'p', { class: 'myClass' }, new ViewText( 'foo' ) ), objWithContext );
|
|
|
|
|
|
|
+ result = dispatcher.convert(
|
|
|
|
|
+ new ViewContainerElement( 'p', { class: 'myClass' }, new ViewText( 'foo' ) ), objWithContext
|
|
|
|
|
+ ).conversionResult;
|
|
|
modelRoot.appendChildren( result );
|
|
modelRoot.appendChildren( result );
|
|
|
expect( modelToString( result ) ).to.equal( '<customP>foo</customP>' );
|
|
expect( modelToString( result ) ).to.equal( '<customP>foo</customP>' );
|
|
|
} );
|
|
} );
|
|
@@ -403,13 +417,13 @@ describe( 'View converter builder', () => {
|
|
|
|
|
|
|
|
const viewElement = new ViewContainerElement( 'p', { class: 'decorated small' }, new ViewText( 'foo' ) );
|
|
const viewElement = new ViewContainerElement( 'p', { class: 'decorated small' }, new ViewText( 'foo' ) );
|
|
|
|
|
|
|
|
- const result = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ const { conversionResult } = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
// P element and it's children got converted by the converter (1) and the converter (1) got fired
|
|
// P element and it's children got converted by the converter (1) and the converter (1) got fired
|
|
|
// because P name was not consumed in converter (2). Converter (3) could consume class="small" because
|
|
// because P name was not consumed in converter (2). Converter (3) could consume class="small" because
|
|
|
// only class="decorated" was consumed in converter (2).
|
|
// only class="decorated" was consumed in converter (2).
|
|
|
- expect( modelToString( result ) ).to.equal( '<paragraph decorated="true" size="small">foo</paragraph>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<paragraph decorated="true" size="small">foo</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should convert from matcher instance to model', () => {
|
|
it( 'should convert from matcher instance to model', () => {
|
|
@@ -427,10 +441,10 @@ describe( 'View converter builder', () => {
|
|
|
new ViewContainerElement( 'abcd', null, new ViewText( 'foo' ) )
|
|
new ViewContainerElement( 'abcd', null, new ViewText( 'foo' ) )
|
|
|
] );
|
|
] );
|
|
|
|
|
|
|
|
- let result = dispatcher.convert( viewStructure, objWithContext );
|
|
|
|
|
- modelRoot.appendChildren( result );
|
|
|
|
|
|
|
+ let { conversionResult } = dispatcher.convert( viewStructure, objWithContext );
|
|
|
|
|
+ modelRoot.appendChildren( conversionResult );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) ).to.equal( '<div class="myClass"><abcd>foo</abcd></div>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<div class="myClass"><abcd>foo</abcd></div>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should filter out structure that is wrong with schema - elements', () => {
|
|
it( 'should filter out structure that is wrong with schema - elements', () => {
|
|
@@ -447,9 +461,9 @@ describe( 'View converter builder', () => {
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- let result = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
|
|
+ let { conversionResult } = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) ).to.equal( '<paragraph>foo</paragraph>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<paragraph>foo</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'should filter out structure that is wrong with schema - attributes', () => {
|
|
it( 'should filter out structure that is wrong with schema - attributes', () => {
|
|
@@ -466,8 +480,8 @@ describe( 'View converter builder', () => {
|
|
|
)
|
|
)
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- let result = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
|
|
+ let { conversionResult } = dispatcher.convert( viewElement, objWithContext );
|
|
|
|
|
|
|
|
- expect( modelToString( result ) ).to.equal( '<paragraph>foo</paragraph>' );
|
|
|
|
|
|
|
+ expect( modelToString( conversionResult ) ).to.equal( '<paragraph>foo</paragraph>' );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|