DEV: Don't reload looping tests when cancelling (#24551)

This commit is contained in:
Jarek Radosz 2023-11-25 18:09:36 +01:00 committed by GitHub
parent 34a859d628
commit 3912a2dc24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -50,6 +50,7 @@ import { loadSprites } from "../lib/svg-sprite-loader";
const Plugin = $.fn.modal;
const Modal = Plugin.Constructor;
let cancelled = false;
function AcceptanceModal(option, _relatedTarget) {
return this.each(function () {
@ -186,6 +187,7 @@ function setupToolbar() {
}
if (["INPUT", "SELECT", "LABEL"].includes(target.tagName)) {
cancelled = true;
document.querySelector("#qunit-abort-tests-button")?.click();
}
});
@ -364,7 +366,7 @@ export default function setupTests(config) {
if (getUrlParameter("loop")) {
QUnit.done(({ failed }) => {
if (failed === 0) {
if (failed === 0 && !cancelled) {
window.location.reload();
}
});