Sfoglia il codice sorgente

test: stabilize markdown web snapshots

Turtle 1 mese fa
parent
commit
e24ed27f5f

+ 5 - 1
apps/web/tests/markdown-cjk-strong.e2e.ts

@@ -36,6 +36,7 @@ const CASES = [
 /** Build one settled assistant reply covering CJK-adjacent strong punctuation boundaries. */
 function markdownFixture(): string {
   const session = Session.create(SessionId('markdown-cjk-strong-source'))
+  const eventTimeOrigin = new Date().setHours(12, 0, 0, 0)
   session.append('turn/start', { turn: 1 })
   const user = session.append('user/message', createUserMessage({
     content: [{ type: 'text', text: 'Render adjacent CJK strong emphasis.' }],
@@ -75,7 +76,10 @@ function markdownFixture(): string {
       createdAt: 0,
       cwd: '{{cwd}}',
     }),
-    ...session.events.map(event => JSON.stringify(event)),
+    ...session.events.map(event => JSON.stringify({
+      ...event,
+      time: eventTimeOrigin + event.seq * 1_000,
+    })),
     '',
   ].join('\n')
 }

+ 5 - 1
apps/web/tests/markdown-inline-code-links.e2e.ts

@@ -26,6 +26,7 @@ const DONE = 'INLINE_CODE_LINK_DONE'
 /** Build a settled assistant reply with linkable URL code and inert code controls. */
 function markdownFixture(linkUrl: string): string {
   const session = Session.create(SessionId('markdown-inline-code-links-source'))
+  const eventTimeOrigin = new Date().setHours(12, 0, 0, 0)
   session.append('turn/start', { turn: 1 })
   const user = session.append('user/message', createUserMessage({
     content: [{ type: 'text', text: 'Show the local preview URL.' }],
@@ -72,7 +73,10 @@ function markdownFixture(linkUrl: string): string {
       createdAt: 0,
       cwd: '{{cwd}}',
     }),
-    ...session.events.map(event => JSON.stringify(event)),
+    ...session.events.map(event => JSON.stringify({
+      ...event,
+      time: eventTimeOrigin + event.seq * 1_000,
+    })),
     '',
   ].join('\n')
 }

+ 1 - 1
apps/web/tests/snapshots/markdown-cjk-strong/ui.expected.md

@@ -49,4 +49,4 @@
   - text: Select model
   - img
 - button "Send message" [disabled]
-- text: 1 turns · 1 steps Input 0 tok · Output 0 tok
+- text: 1 turns · 1 steps LLM {{duration}} Input 0 tok · Output 0 tok

+ 1 - 1
apps/web/tests/snapshots/markdown-inline-code-links/ui.expected.md

@@ -40,4 +40,4 @@
   - text: Select model
   - img
 - button "Send message" [disabled]
-- text: 1 turns · 1 steps Input 0 tok · Output 0 tok
+- text: 1 turns · 1 steps LLM {{duration}} Input 0 tok · Output 0 tok