Added tests to ap_tests.js