Added unit tests for factories.js
Enabled corrected test in factories.js