mirror of
https://github.com/discourse/discourse.git
synced 2025-04-01 20:56:10 +08:00
DEV: Don't reload looping tests when cancelling (#24551)
This commit is contained in:
parent
34a859d628
commit
3912a2dc24
@ -50,6 +50,7 @@ import { loadSprites } from "../lib/svg-sprite-loader";
|
|||||||
|
|
||||||
const Plugin = $.fn.modal;
|
const Plugin = $.fn.modal;
|
||||||
const Modal = Plugin.Constructor;
|
const Modal = Plugin.Constructor;
|
||||||
|
let cancelled = false;
|
||||||
|
|
||||||
function AcceptanceModal(option, _relatedTarget) {
|
function AcceptanceModal(option, _relatedTarget) {
|
||||||
return this.each(function () {
|
return this.each(function () {
|
||||||
@ -186,6 +187,7 @@ function setupToolbar() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (["INPUT", "SELECT", "LABEL"].includes(target.tagName)) {
|
if (["INPUT", "SELECT", "LABEL"].includes(target.tagName)) {
|
||||||
|
cancelled = true;
|
||||||
document.querySelector("#qunit-abort-tests-button")?.click();
|
document.querySelector("#qunit-abort-tests-button")?.click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -364,7 +366,7 @@ export default function setupTests(config) {
|
|||||||
|
|
||||||
if (getUrlParameter("loop")) {
|
if (getUrlParameter("loop")) {
|
||||||
QUnit.done(({ failed }) => {
|
QUnit.done(({ failed }) => {
|
||||||
if (failed === 0) {
|
if (failed === 0 && !cancelled) {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user