test: cover no-proxy navigation timeout tab isolation

This commit is contained in:
Pradeep Elankumaran
2026-09-08 23:29:58 -07:00
parent 57f4ca9554
commit 6830ac5af0
2 changed files with 26 additions and 0 deletions
+21
View File
@@ -49,6 +49,27 @@ describe('Navigation', () => {
}
});
test('keeps sibling tabs alive when a no-proxy navigation times out', async () => {
const client = createClient(serverUrl);
try {
const { tabId: existingTabId } = await client.createTab(`${testSiteUrl}/pageA`);
const { tabId } = await client.createTab();
await expect(client.request(
'POST',
`/tabs/${tabId}/navigate`,
{ userId: client.userId, url: `${testSiteUrl}/slow-navigation` },
{ timeout: 45000 },
)).rejects.toMatchObject({ status: 500 });
const existingTabSnapshot = await client.getSnapshot(existingTabId);
expect(existingTabSnapshot.snapshot).toContain('Welcome to Page A');
} finally {
await client.cleanup();
}
}, 60000);
test('reports a destination 404 without discarding the rendered page', async () => {
const client = createClient(serverUrl);
+5
View File
@@ -41,6 +41,11 @@ function createTestApp() {
res.status(503).send('Temporarily unavailable');
});
// A response that never completes, used to exercise navigation timeouts.
app.get('/slow-navigation', () => {
// Deliberately leave the HTTP response open until the browser aborts it.
});
// Page that fires a client-side redirect shortly after DOMContentLoaded
app.get('/lateRedirect', (req, res) => {
res.send(`