     output = Blaze.toHTMLWithData componentTemplate,
       top: '42'
 
-    @assertEqual @trim(output), @trim FOO_COMPONENT_CONTENT
+    @assertEqual @trim(output), @trim FOO_COMPONENT_CONTENT()
 
     componentTemplate = BlazeComponent.getComponentTemplate 'SubComponent'
 


BlazeComponent.register 'SubComponent', SubComponent

class BasicTestCase extends ClassyTestCase
  @testName: 'blaze-components - basic'

  FOO_COMPONENT_CONTENT = """
    <p>Other component: FooComponent</p>
    <button>Foo1</button>
    <p></p>
    <button>Foo2</button>
    <p></p>
    <p></p>
  """

  SUB_COMPONENT_CONTENT = """
    <p>Main component: SubComponent</p>
    <button>Foo1</button>
    <p>SubComponent/SubComponent.foobar/{"top":"42"}/{"top":"42"}/SubComponent</p>
    <button>Foo2</button>
    <p>SubComponent/SubComponent.foobar2/{"top":"42"}/{"a":"1","b":"2"}/SubComponent</p>
    <p>SubComponent/MainComponent.foobar3/{"top":"42"}/{"top":"42"}/SubComponent</p>
    <p>Subtemplate</p>
    <button>Foo1</button>
    <p>SubComponent/SubComponent.foobar/{"top":"42"}/{"top":"42"}/SubComponent</p>
    <button>Foo2</button>
    <p>SubComponent/SubComponent.foobar2/{"top":"42"}/{"a":"3","b":"4"}/SubComponent</p>
    <p>SubComponent/MainComponent.foobar3/{"top":"42"}/{"top":"42"}/SubComponent</p>
    #{ FOO_COMPONENT_CONTENT }
  """

  trim: (html) =>
    html = html.replace />\s+/g, '>'

    @assertEqual SubComponent.componentName(), 'SubComponent'
    @assertEqual BlazeComponent.componentName(), null

  testSelfRegister: =>
    @assertTrue BlazeComponent.getComponent 'SelfRegisterComponent'

  testUnregisteredComponent: =>
    componentTemplate = UnregisteredComponent.getComponentTemplate()

    @assertTrue componentTemplate

    output = Blaze.toHTMLWithData componentTemplate,
      top: '42'

    @assertEqual @trim(output), @trim COMPONENT_CONTENT 'UnregisteredComponent'

    componentTemplate = SelfNameUnregisteredComponent.getComponentTemplate()

    @assertTrue componentTemplate

    output = Blaze.toHTMLWithData componentTemplate,
      top: '42'

    # We have not extended any helper on purpose, so they should still use "UnregisteredComponent".
    @assertEqual @trim(output), @trim COMPONENT_CONTENT 'SelfNameUnregisteredComponent', 'UnregisteredComponent'

ClassyTestCase.addTest new BasicTestCase()
