浏览代码

test(web): normalize abort snapshot date

ZiyaZhang 1 月之前
父节点
当前提交
e63df333a1
共有 2 个文件被更改,包括 4 次插入 和 1 次删除
  1. 3 0
      apps/web/tests/bash-abort-row.e2e.ts
  2. 1 1
      apps/web/tests/snapshots/bash-abort-row/ui.expected.md

+ 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)
     await expect.poll(() => call.getByText('Error: command aborted', { exact: true }).count()).toBe(2)
 
 
     const snapshot = (await captureStableAria(page, '[class*="centerCol"]', scaffold.workspaceCwd))
     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}}')
       .split(SEED_ID).join('{{seededId}}')
     await compareOrRefreshGolden(UI_EXPECTED, snapshot, MODE)
     await compareOrRefreshGolden(UI_EXPECTED, snapshot, MODE)
     expect(tripwire.pageErrors).toEqual([])
     expect(tripwire.pageErrors).toEqual([])

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

@@ -4,7 +4,7 @@
   - tablist:
   - tablist:
     - tab "Chat" [selected]
     - tab "Chat" [selected]
     - tab "Trajectory"
     - 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":
 - button "Copy":
   - img
   - img
 - button "Branch into a new conversation":
 - button "Branch into a new conversation":