Skip Zotero.Prompt button delay in CI

The button delay started causing test failures in GitHub Actions after
updating to Firefox 115.14.0esr.
This commit is contained in:
Dan Stillman 2024-08-28 02:22:26 -04:00
parent 4549cbf1ed
commit f9faa0415f

View file

@ -68,7 +68,8 @@ Zotero.Prompt = {
if (checkLabel && (!checkbox || typeof checkbox != 'object')) {
throw new Error('`checkLabel` provided without `checkbox` option');
}
let flags = delayButtons ? Services.prompt.BUTTON_DELAY_ENABLE : 0;
// Skip button delay in CI
let flags = (delayButtons && !Zotero.automatedTest) ? Services.prompt.BUTTON_DELAY_ENABLE : 0;
if (typeof button0 == 'number') flags += Services.prompt.BUTTON_POS_0 * button0;
else if (typeof button0 == 'string') flags += Services.prompt.BUTTON_POS_0 * Services.prompt.BUTTON_TITLE_IS_STRING;
if (typeof button1 == 'number') flags += Services.prompt.BUTTON_POS_1 * button1;