test: align Plus return wait expectation

This commit is contained in:
QLHazyCoder
2026-04-26 17:57:07 +08:00
parent 05d48e6cc1
commit 78a141d380
+3 -3
View File
@@ -6,7 +6,7 @@ const source = fs.readFileSync('background/steps/plus-return-confirm.js', 'utf8'
const globalScope = {};
const api = new Function('self', `${source}; return self.MultiPageBackgroundPlusReturnConfirm;`)(globalScope);
test('Plus return confirm waits a fixed 40 seconds after return URL is detected', async () => {
test('Plus return confirm waits a fixed 20 seconds after return URL is detected', async () => {
const events = [];
const executor = api.createPlusReturnConfirmExecutor({
addLog: async (message, level = 'info') => {
@@ -36,10 +36,10 @@ test('Plus return confirm waits a fixed 40 seconds after return URL is detected'
assert.deepEqual(
events.find((event) => event.type === 'sleep'),
{ type: 'sleep', ms: 40000 }
{ type: 'sleep', ms: 20000 }
);
assert.equal(
events.some((event) => event.type === 'log' && /固定等待 40 秒/.test(event.message)),
events.some((event) => event.type === 'log' && /固定等待 20 秒/.test(event.message)),
true
);
assert.deepEqual(