fix: foreground mobile delivery attention handoffs (Closes #1018)
This commit is contained in:
1 parent
6913fc8257
commit
3fde7cf3ad
5 files changed
+156
-14
No files matched your search
@@ -194,6 +194,40 @@ def test_release_artifact_keeps_mobile_delivery_recovery_single_flight(tmp_path:
|
||||
page.evaluate("Promise.all([window.__firstRecovery, window.__secondRecovery])")
|
||||
expect(action).to_be_enabled()
|
||||
assert page.evaluate("window.__deliveryAttempts") == 1
|
||||
|
||||
page.evaluate(
|
||||
"""
|
||||
() => {
|
||||
const destination = document.createElement('button');
|
||||
destination.type = 'button';
|
||||
destination.className = 'draft-resume';
|
||||
destination.dataset.draftIndex = '0';
|
||||
destination.textContent = 'Open current review';
|
||||
window.__attentionAttempts = 0;
|
||||
window.__attentionSettled = new Promise(resolve => { window.__finishAttention = resolve; });
|
||||
destination.onclick = async () => {
|
||||
window.__attentionAttempts += 1;
|
||||
await window.__attentionSettled;
|
||||
return true;
|
||||
};
|
||||
document.querySelector('#my-work-list').append(destination);
|
||||
window.__attentionRecovery = createMobileDeliveryRecovery({
|
||||
getItems: () => [{outbox_id:'review-attention', status:'attention', title:'Review feedback'}],
|
||||
getIndex: () => 0,
|
||||
});
|
||||
window.__attentionRecovery.open();
|
||||
window.__firstAttention = window.__attentionRecovery.activate();
|
||||
window.__secondAttention = window.__attentionRecovery.activate();
|
||||
}
|
||||
"""
|
||||
)
|
||||
expect(page.locator("#mobile-delivery-recovery")).to_be_hidden()
|
||||
expect(page.locator("#my-work-list .draft-resume")).to_be_focused()
|
||||
assert page.evaluate("window.__attentionAttempts") == 1
|
||||
assert page.evaluate("document.documentElement.scrollWidth <= window.innerWidth")
|
||||
page.evaluate("window.__finishAttention()")
|
||||
page.evaluate("Promise.all([window.__firstAttention, window.__secondAttention])")
|
||||
assert page.evaluate("window.__attentionAttempts") == 1
|
||||
assert browser_errors == []
|
||||
browser.close()
|
||||
finally:
|
||||
|
||||
Reference in new issue
Block a user