Introduction
------------

Setup the test framework::

    >>> from zope.component import getMultiAdapter
    >>> from Testing.testbrowser import Browser
    >>> browser = Browser()
    >>> portal_url = 'http://nohost/plone'

We should already be installed::

    >>> import plone.app.jquerytools


Javascript Resource and View
----------------------------

We should have three items in the JS registry::

    >>> jsreg = portal.portal_javascripts
    >>> ids = jsreg.getResourceIds()
    >>> '++resource++plone.app.jquerytools.js' in ids
    True

    >>> '++resource++plone.app.jquerytools.overlayhelpers.js' in ids
    True

    >>> '++resource++plone.app.jquerytools.plugins.js' in ids
    True

Open the main JS code item as a resource::

    >>> browser.open(portal_url+'/++resource++plone.app.jquerytools.js')

And, make sure it's got our code in it::

    >>> print browser.contents
    /*
    ...
     jQuery Tools v...
    ...

Open the overlay helper code item as a resource::

    >>> browser.open(portal_url+'/++resource++plone.app.jquerytools.overlayhelpers.js')

And, make sure it's got our code in it::

    >>> print browser.contents
    /*****************
    <BLANKLINE>
    jQuery Tools overlay helpers.
    ...

Open the plugins item as a resource::

    >>> browser.open(portal_url+'/++resource++plone.app.jquerytools.plugins.js')

And, make sure it's got our code in it::

    >>> print browser.contents
    /*
    <BLANKLINE>
     jQuery Tools ...
    ...

Open the test page::

    >>> browser.open(portal_url+'/@@p.a.jqt.testPage')
    
    >>> browser.contents.find("Test AJAX Form Popup") > 0
    True
    
