mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-11-17 21:43:06 +00:00
🧪 test: Route the Benchmark and BYOM Unroutes Through the Shared Helper (#18085)
This commit is contained in:
parent
40671fd88c
commit
fb4150e077
3 changed files with 5 additions and 3 deletions
|
|
@ -132,7 +132,7 @@ context and its pages before Playwright closes it, and what a detached handler t
|
|||
is ignored. A context the spec opens itself with `browser.newContext()` closes through
|
||||
`closeContext(context)` from the same module.
|
||||
|
||||
A mock spec that removes a route before its test ends calls `unroute(page, url, handler)` from that
|
||||
A spec that removes a route before its test ends calls `unroute(page, url, handler)` from that
|
||||
module in place of `page.unroute()`. When `page.unroute()` removes a page's last route, Playwright
|
||||
stops intercepting there and continues the requests its handlers were still working on, so a
|
||||
handler in the middle of one throws `Route is already handled!` and fails the test. `unroute`
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import {
|
|||
seedMessages,
|
||||
} from '../specs/mock/db';
|
||||
import { messagesView } from '../specs/mock/helpers';
|
||||
import { unroute } from '../specs/mock/fixtures';
|
||||
import { getE2EUser } from '../setup/user';
|
||||
import {
|
||||
attachSnapshot,
|
||||
|
|
@ -224,7 +225,7 @@ async function holdConversationRecord(page: Page, conversationId: string) {
|
|||
|
||||
return async () => {
|
||||
release();
|
||||
await page.unroute(pattern);
|
||||
await unroute(page, pattern);
|
||||
return heldRequests;
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import {
|
|||
sendMessage,
|
||||
sendMessageAndWaitForCompletion,
|
||||
} from '../specs/mock/helpers';
|
||||
import { unroute } from '../specs/mock/fixtures';
|
||||
|
||||
interface Pairing {
|
||||
environment: { id: string };
|
||||
|
|
@ -345,7 +346,7 @@ test('native BYOM saves, persists, isolates workers, and fails closed', async ({
|
|||
await route.continue();
|
||||
});
|
||||
const conversationId = await chat('Keep this conversation and its history.');
|
||||
await page.unroute(streamRoute);
|
||||
await unroute(page, streamRoute);
|
||||
const ordinaryDecision = await readDecision(conversationId);
|
||||
expect(ordinaryDecision.codeEnvironmentMode).toBe('without_attached');
|
||||
expect(ordinaryDecision.codeWorkspaces ?? []).toEqual([]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue