Implemented test using Sinon.JS