refactored tests
refactored code to add className empty check