tests: Admin Frontend Test Coverage(#4717)

Covers all frontend admin operations, runs separated in CI.
This commit is contained in:
John McLear 2021-02-07 11:32:57 +00:00 committed by GitHub
parent 294f2a251f
commit 2b112ac851
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 463 additions and 50 deletions

View file

@ -1,4 +1,5 @@
'use strict';
const helper = {}; // eslint-disable-line no-redeclare
(function () {
@ -180,6 +181,22 @@ const helper = {}; // eslint-disable-line no-redeclare
return padName;
};
helper.newAdmin = async function (page) {
// define the iframe
$iframe = $(`<iframe src='/admin/${page}'></iframe>`);
// clean up inner iframe references
helper.admin$ = null;
// remove old iframe
$('#iframe-container iframe').remove();
// set new iframe
$('#iframe-container').append($iframe);
$iframe.one('load', () => {
helper.admin$ = getFrameJQuery($('#iframe-container iframe'));
});
};
helper.waitFor = function (conditionFunc, timeoutTime = 1900, intervalTime = 10) {
const deferred = new $.Deferred();