feat(qaops): 接通网页通讯录持久化同步与后台接管
This commit is contained in:
@@ -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] ?? ''
|
||||
|
||||
Reference in New Issue
Block a user