nodeType property error when using selectors like: $(widget)

When I updated my project to 1.4.3 version I noticed $ method complains about the nodeType property when doing $(widget).
This is a bit weak, its better to use g.isVisible(), the same below. 
Also remember to detach the widget, so as we don't interfere with other tests