Add tests for element visibility

Add a few tests for element visibility in clientutils.js