feat(qaops): 接通网页通讯录持久化同步与后台接管

This commit is contained in:
姚章浩
2026-10-17 17:36:07 +08:00
parent 6adfdcdd4f
commit cc4906b6a9
25 changed files with 1203 additions and 24 deletions
+24
View File
@@ -51,6 +51,30 @@ const props = {
onRemoveMissing: vi.fn(),
}
describe('region mapping workbench', () => {
it('shows real synchronization stages without inventing progress and protects dirty drafts', () => {
const syncStatus = {
configured: true,
worker_ready: true,
job: {
id: 'j',
state: 'running' as const,
attempt: 1,
max_attempts: 3,
updated_at: '2026-10-17T08:00:00Z',
error_code: '',
result: null,
},
}
const html = renderToStaticMarkup(<RegionMappingView {...props} syncStatus={syncStatus} />)
expect(html).toContain('正在读取并校验通讯录')
expect(html).not.toMatch(/\d+%/)
expect(html).toMatch(/disabled=""[^>]*>同步通讯录/)
const dirty = renderToStaticMarkup(
<RegionMappingView {...props} dirty syncStatus={{ configured: true, worker_ready: true, job: null }} />
)
expect(dirty).toContain('未保存的区域修改')
expect(dirty).toMatch(/disabled=""[^>]*>同步通讯录/)
})
it('lets long directory paths wrap instead of inheriting the global nowrap table rule', () => {
const css = readFileSync(new URL('./qaRegions.css', import.meta.url), 'utf8')
const bodyRule = css.match(/\.qa-region-table td\s*\{([^}]+)\}/)?.[1] ?? ''