feat: add configurable operation delay
This commit is contained in:
@@ -954,16 +954,23 @@ const window = {
|
||||
},
|
||||
};
|
||||
|
||||
const operationDelayCalls = [];
|
||||
|
||||
async function sleep() {}
|
||||
function simulateClick(node) {
|
||||
node.click();
|
||||
}
|
||||
async function performOperationWithDelay(metadata, operation) {
|
||||
operationDelayCalls.push({ label: metadata.label, kind: metadata.kind });
|
||||
return await operation();
|
||||
}
|
||||
|
||||
${bundle}
|
||||
|
||||
return {
|
||||
rememberCheckbox,
|
||||
agreementCheckbox,
|
||||
operationDelayCalls,
|
||||
ensureAgreementChecked,
|
||||
};
|
||||
`)();
|
||||
@@ -973,4 +980,8 @@ return {
|
||||
assert.equal(result, true);
|
||||
assert.equal(api.rememberCheckbox.checked, true);
|
||||
assert.equal(api.agreementCheckbox.checked, true);
|
||||
assert.deepStrictEqual(api.operationDelayCalls, [
|
||||
{ label: 'mail2925-agreement-checkbox', kind: 'click' },
|
||||
{ label: 'mail2925-agreement-checkbox', kind: 'click' },
|
||||
]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user