Fix tests for existing elements

The type of a just created HTMLElement is never undefined, it is
actually an object of type HTMLUnknownElement. So now instead of
comparing to undefined, the tests check if the element is an instance of
HTMLUnknownElement and fails if it is.
Merge pull request #311 from lucianafujii/version-5.0

Fix tests for existing elements