frontend js validation with mocha tests