Prettify: fix unit test checking className attribute

Makes sure the element has a className attribute before
attempting indexOf call.
Toggle: fix unit test checking className attribute

Makes sure the element has a className attribute before
attempting indexOf call.
Merge pull request #4485 from patheard/unit-test-prettify

Unit tests: fix tests that check className of elements