Skip to content

Commit 4bd3a4c

Browse files
committed
fix(visual): mask context-token counter in electron sidebar snapshot
1 parent 8535808 commit 4bd3a4c

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

Binary file not shown.

‎apps/vscode-e2e/src/visual/electron.visual.ts‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,16 @@ for (const scenario of scenarios) {
236236
await expect.poll(() => contentFrame.evaluate(() => document.activeElement === document.body)).toBe(true)
237237
await contentFrame.evaluate(() => document.fonts.ready)
238238

239+
// Hide dynamic token counter values so system-prompt changes do not
240+
// break the snapshot when rendered layout and styling are unchanged.
241+
// An injected stylesheet survives React re-renders; inline style does not.
242+
await contentFrame.evaluate(() => {
243+
const style = document.createElement("style")
244+
style.textContent =
245+
'[data-testid="context-tokens-count"],[data-testid="context-window-size"]{visibility:hidden!important}'
246+
document.head.appendChild(style)
247+
})
248+
239249
const sidebar = running.page.locator(".part.sidebar")
240250
await expect(sidebar).toBeVisible()
241251
await expect(sidebar).toHaveScreenshot(`electron-${scenario.name}-sidebar.png`)

0 commit comments

Comments
 (0)