Added JavaScript unit tests