mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-07-09 19:04:33 -04:00
Update tests to use most recent jest and supporting libraries
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user