Просмотр исходного кода

test(web): normalize abort snapshot date

ZiyaZhang 1 месяц назад
Родитель
Сommit
e63df333a1

+ 3 - 0
apps/web/tests/bash-abort-row.e2e.ts

@@ -67,6 +67,9 @@ describe.skipIf(MODE === 'record')('web e2e: cancelled Bash row disclosure', ()
     await expect.poll(() => call.getByText('Error: command aborted', { exact: true }).count()).toBe(2)
 
     const snapshot = (await captureStableAria(page, '[class*="centerCol"]', scaffold.workspaceCwd))
+      // The borrowed fixture's UTC date is still the previous day in PDT;
+      // the disclosure golden must not depend on the runner timezone.
+      .replace(/\b\d{1,2}\/\d{1,2}(?= \{\{clock\}\})/g, '{{date}}')
       .split(SEED_ID).join('{{seededId}}')
     await compareOrRefreshGolden(UI_EXPECTED, snapshot, MODE)
     expect(tripwire.pageErrors).toEqual([])

+ 1 - 1
apps/web/tests/snapshots/bash-abort-row/ui.expected.md

@@ -4,7 +4,7 @@
   - tablist:
     - tab "Chat" [selected]
     - tab "Trajectory"
-- text: "Run two shell commands: wait for cancellation, then write skipped.txt. 7/18 {{clock}}"
+- text: "Run two shell commands: wait for cancellation, then write skipped.txt. {{date}} {{clock}}"
 - button "Copy":
   - img
 - button "Branch into a new conversation":