2019-04-19 18:17:41 +02:00
|
|
|
const fs = require("fs");
|
|
|
|
const { JSDOM } = require("jsdom");
|
2019-09-11 13:40:45 +02:00
|
|
|
const template = fs.readFileSync("templates/analytics/realm_details.html", "utf-8");
|
2019-04-19 18:17:41 +02:00
|
|
|
const dom = new JSDOM(template, { pretendToBeVisual: true });
|
|
|
|
const document = dom.window.document;
|
|
|
|
|
|
|
|
var jquery_init;
|
|
|
|
global.$ = (f) => {jquery_init = f;};
|
|
|
|
zrequire('support', "js/analytics/support");
|
|
|
|
set_global('$', global.make_zjquery());
|
|
|
|
|
|
|
|
run_test('scrub_realm', () => {
|
|
|
|
jquery_init();
|
|
|
|
var click_handler = $('body').get_on_handler('click', '.scrub-realm-button');
|
|
|
|
assert.equal(typeof click_handler, 'function');
|
|
|
|
|
2019-09-11 13:40:45 +02:00
|
|
|
assert.equal(document.querySelectorAll(".scrub-realm-button").length, 1);
|
2019-04-19 18:17:41 +02:00
|
|
|
});
|