Update tests to use most recent jest and supporting libraries

This commit is contained in:
Ryan Ahearn
2022-10-27 11:12:39 -04:00
parent 98b772f959
commit bb2d57b27b
14 changed files with 1080 additions and 109 deletions

View File

@@ -34,7 +34,7 @@
Analytics.prototype.trackPageview = function (path, title, options) {
// strip UUIDs
const page = (window.location.pathname + window.location.search).replace(
const page = `${window.location.pathname}${window.location.search}`.replace(
/[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/g, '…'
);
window.ga('send', 'pageview', page);

View File

@@ -80,23 +80,25 @@
let startTime = Date.now();
if (document.visibilityState !== "hidden" && queue.push(renderer) === 1) $.ajax(
resource,
{
'method': form ? 'post' : 'get',
'data': form ? $('#' + form).serialize() : {}
}
).done(
response => {
flushQueue(queue, response);
if (response.stop === 1) {
poll = function(){};
if (document.visibilityState !== "hidden" && queue.push(renderer) === 1) {
$.ajax(
resource,
{
'method': form ? 'post' : 'get',
'data': form ? $('#' + form).serialize() : {}
}
interval = calculateBackoff(Date.now() - startTime);
}
).fail(
() => poll = function(){}
);
).done(
response => {
flushQueue(queue, response);
if (response.stop === 1) {
poll = function(){};
}
interval = calculateBackoff(Date.now() - startTime);
}
).fail(
() => poll = function(){}
);
}
setTimeout(
() => poll.apply(window, arguments), interval