From 9c90a3d1a362db74fbc1682fcea1137f94bd0dfd Mon Sep 17 00:00:00 2001 From: Aditya Bansal Date: Thu, 6 Jul 2017 05:08:28 +0530 Subject: [PATCH] zjquery: Add get_on_handler(). --- frontend_tests/zjsunit/zjquery.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frontend_tests/zjsunit/zjquery.js b/frontend_tests/zjsunit/zjquery.js index 5f8b412dfa..0cdad77167 100644 --- a/frontend_tests/zjsunit/zjquery.js +++ b/frontend_tests/zjsunit/zjquery.js @@ -86,6 +86,11 @@ exports.make_zjquery = function () { assert.equal(idx, 0); return selector; }, + get_on_handler: function (name, child_selector) { + var funcs = self.get_on_handlers(name, child_selector); + assert.equal(funcs.length, 1, 'We expected to have exactly one handler here.'); + return funcs[0]; + }, get_on_handlers: function (name, child_selector) { if (child_selector === undefined) { return on_functions.get(name) || [];