test(bot-mode): keep the reproducible mock patch whitespace-clean
This commit is contained in:
@@ -6,13 +6,13 @@ Run from the repository root after installing root npm dependencies and building
|
||||
|
||||
```sh
|
||||
cp evals/botmode-dm-matrix/probe-dm-matrix.spec.ts apps/desktop/e2e/
|
||||
git apply evals/botmode-dm-matrix/mock-trigger.patch
|
||||
git apply --unidiff-zero evals/botmode-dm-matrix/mock-trigger.patch
|
||||
(cd apps/desktop && npm run build)
|
||||
# Set DISPLAY, current XAUTHORITY, XDG_RUNTIME_DIR and VIRTUAL_ENV first.
|
||||
(cd apps/desktop && HERMES_DESKTOP_CDP_PORT=off BOT_DM_SERVICE_PATH=1 \
|
||||
BOT_DM_EVIDENCE=/tmp/botmode-dm-matrix-proof \
|
||||
npx playwright test e2e/probe-dm-matrix.spec.ts --reporter=list)
|
||||
git apply -R evals/botmode-dm-matrix/mock-trigger.patch
|
||||
git apply --unidiff-zero -R evals/botmode-dm-matrix/mock-trigger.patch
|
||||
rm apps/desktop/e2e/probe-dm-matrix.spec.ts
|
||||
```
|
||||
|
||||
|
||||
@@ -2,10 +2,7 @@ diff --git a/tests-js/scripts/mock-server.ts b/tests-js/scripts/mock-server.ts
|
||||
index 6dffd2cf0f388..09c6de07d81b2 100644
|
||||
--- a/tests-js/scripts/mock-server.ts
|
||||
+++ b/tests-js/scripts/mock-server.ts
|
||||
@@ -500,6 +500,21 @@ export function startMockServer(options: MockServerOptions = {}): Promise<MockSe
|
||||
_receivedUserTexts.push(userText)
|
||||
}
|
||||
|
||||
@@ -502,0 +503,15 @@ export function startMockServer(options: MockServerOptions = {}): Promise<MockSe
|
||||
+ const dmMatch = userText.match(/E2E_DM\(([^)]+)\)\[([\s\S]*)\]/)
|
||||
+ const lastUserIndex = messages.lastIndexOf(lastUserMsg)
|
||||
+ if (dmMatch && !messages.slice(lastUserIndex + 1).some(m => m?.role === 'tool')) {
|
||||
@@ -21,6 +18,3 @@ index 6dffd2cf0f388..09c6de07d81b2 100644
|
||||
+ return
|
||||
+ }
|
||||
+
|
||||
const isInterimTrigger = userText.includes('E2E_INTERIM_TRIGGER')
|
||||
const isSidebarTrigger = userText.includes('E2E_SIDEBAR_TRIGGER')
|
||||
const isSidebarCrossTrigger = userText.includes('E2E_SIDEBAR_CROSS')
|
||||
|
||||
Reference in New Issue
Block a user