add tests on functional.spec.js