rendering dom nodes through a test

26 views
Skip to first unread message

johnb

unread,
Feb 27, 2012, 4:05:12 PM2/27/12
to JsTestDriver
Hi Folks,

So - my question is regarding widgets and other JS entities that
manage dom nodes. Lets say that - as part of the test - the JS
function creates a DOM node - will that DOM node be rendered in the
browsers? I suspect that it can, but I was hoping to leverage any
examples that would demonstrate this use case.

Thanks in advance for any help.

Regards,

John Brinnand

Logan Allred

unread,
Mar 3, 2012, 9:16:14 AM3/3/12
to js-test...@googlegroups.com
Our tests render DOM nodes in the browser. They go so fast you can't actually see them unless you set a breakpoint, and because we don't serve any CSS or support files it's just the raw unstyled HTML, so it doesn't look like the application.

But for unit tests, that's all we need. We're validating that our view layer generates the correct DOM structure given the inputs. We don't drive the browser, we invoke the event handlers and DOM methods directly in the tests, then validate the structure changed accordingly.

We use Selenium as well to test the actual running application and interaction between our widgets. JsTestDriver does the unit tests for our widgets to make sure they behave standalone.

Logan
Reply all
Reply to author
Forward
0 new messages