nl_tokens: setupComponent - Assumes it has been called in the context of a jasmine spec . - Creates a new HTML element and attaches to it an instance of this . Component - If a fixture is provided the fixture will serve as the component root .
pl_tokens: function setupComponent ( fixture , options ) { // tear down any existing component instance if ( this . component ) { this . component . teardown ( ) ; this . $node . remove ( ) ; } if ( fixture instanceof jQuery || typeof fixture === 'string' ) { // use the fixture to create component root node this . $node = $ ( fixture ) . addClass ( 'component-root' ) ; } else { // create an empty component root node this . $node = $ ( '<div class="component-root" />' ) ; <mask> = fixture ; fixture = null ; } // append component root node to body $ ( 'body' ) . append ( this . $node ) ; // normalize options options = options === undefined ? { } : options ; // instantiate component on component root node this . component = ( new this . Component ( ) ) . initialize ( this . $node , options ) ; }