Skip to content

Instantly share code, notes, and snippets.

@nb
Created January 22, 2015 11:04
Show Gist options
  • Save nb/ba0497cf0c8f16404f6c to your computer and use it in GitHub Desktop.
Save nb/ba0497cf0c8f16404f6c to your computer and use it in GitHub Desktop.
it( 'should handle series of same component', function() {
var expectedResultString = '<span><a href="#">baba</a><a href="#">dyado</a></span>',
translatedComponent = translate( '{{link}}baba{{/link}}{{link}}dyado{{/link}}', { components: { link: link } } );
assert.equal( expectedResultString, stripReactAttributes( React.renderToString( translatedComponent ) ) );
} );
it( 'should handle wrong cross-nesting', function() {
var expectedResultString = '', // how do we return error?
translatedComponent = translate( '{{link}}a{{em}}b{{/link}}c{{/em}}', { components: { link: link, em: em } } );
assert.equal( expectedResultString, stripReactAttributes( React.renderToString( translatedComponent ) ) );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment