Make Stuffbox linking resilient to cross-origin popup isolation and stale callbacks
Hop-State: A_06FP8WHY25K99094H3X60A8 Hop-Proposal: R_06FP8WGCVDDG61H0VZ1XQJR Hop-Task: T_06FP8V5D2HSJG08NRN6VS3G Hop-Attempt: AT_06FP8V5D2KATGJNV2M2SGRR
This commit is contained in:
@@ -3,10 +3,11 @@ import { renderStuffboxPopupResponse } from './popup-response';
|
||||
|
||||
describe('renderStuffboxPopupResponse', () => {
|
||||
it('notifies the main tab without navigating the popup into Synapsis', () => {
|
||||
const html = renderStuffboxPopupResponse('https://synapsis.example', true, 'Stuffbox connected.');
|
||||
const html = renderStuffboxPopupResponse('https://synapsis.example', true, 'Stuffbox connected.', 'attempt-123');
|
||||
|
||||
expect(html).toContain("new BroadcastChannel('synapsis:stuffbox')");
|
||||
expect(html).toContain("localStorage.setItem('synapsis:stuffbox:result'");
|
||||
expect(html).toContain('attempt-123');
|
||||
expect(html).toContain('window.setTimeout(() => window.close(), 250)');
|
||||
expect(html).not.toContain('window.location.replace');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user