fix(sync): harden terminal state races

This commit is contained in:
Timo
2026-09-01 03:34:01 +02:00
parent 77e7d0c103
commit bc5d1a0ea6
5 changed files with 55 additions and 10 deletions
+2
View File
@@ -118,6 +118,8 @@ describe('target tab lifecycle', () => {
expect(clearSource).toContain('resetUserSelectionState()');
expect(clearSource).toContain('deactivateTargetTab(previousTabId, previousContentTarget)');
expect(clearSource).toContain('selectedTabId: null');
expect(clearSource.indexOf('selectedTabId: null'))
.toBeLessThan(clearSource.indexOf('await Promise.all(cleanupTasks)'));
expect(clearSource).toContain("type: 'TARGET_TAB_CLEARED'");
expect(popupSource).toContain("refreshTargetAccessState({ autoSelectMatch: false })");
expect(popupSource).toContain('if (autoSelectMatch && matchOpt && elements.targetTab.options.length > 1)');