chore: establish YCode replication baseline and TODO

This commit is contained in:
xiaohan.yuan committed 2026-10-17 02:43:49 +08:00
commit 6dc59f89ba
1118 files changed
+196002

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
import { renderToStaticMarkup } from 'react-dom/server'
import { NativeBrowserPane } from '../src/renderer/src/workbuddy/workbench/NativeBrowserPane'
;(globalThis as any).window = { ycode: { browser: {} } }
const markup = renderToStaticMarkup(<NativeBrowserPane id="browser-fixture" sessionId="fixture" />)
assert.match(markup, /data-browser-host-id="browser-fixture"/)
assert.match(markup, /_browserToolbar_x8iy7_18 _nativeToolbar_rh4x8_319/)
assert.match(markup, /搜索或输入网址/)
assert.match(markup, /输入网址,或打开对话中的链接/)
assert.match(markup, /aria-label="后退" disabled/)
assert.match(markup, /M5\.2806 11\.9404/)
assert.match(markup, /M7\.4702 11\.9404/)
assert.match(markup, /M14\.83 7\.415/)
const css = readFileSync('src/renderer/src/workbuddy/workbench/browser-source.css', 'utf8')
assert.match(css, /\._browserToolbar_x8iy7_18\{[^}]*padding:8px 16px/)
assert.match(css, /\._browserUrl_rh4x8_10\{[^}]*height:28px/)
console.log('Native browser toolbar, disabled state, source locale/SVG and CSS contracts passed')