fix(qaops): 修复长部门路径挤出区域与依据列

This commit is contained in:
姚章浩
2026-10-17 16:24:00 +08:00
parent 5874134e04
commit 6adfdcdd4f
3 changed files with 17 additions and 0 deletions
+10
View File
@@ -1,4 +1,6 @@
import { renderToStaticMarkup } from 'react-dom/server'
// @ts-expect-error The test runner provides Node; the browser bundle intentionally omits @types/node.
import { readFileSync } from 'node:fs'
import { describe, expect, it, vi } from 'vitest'
import { RegionMappingView } from './QARegions'
import { parseOrganization } from './qaOrg'
@@ -49,6 +51,14 @@ const props = {
onRemoveMissing: vi.fn(),
}
describe('region mapping workbench', () => {
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] ?? ''
expect(bodyRule).toMatch(/white-space:\s*normal/)
expect(bodyRule).toMatch(/overflow-wrap:\s*anywhere/)
const statusRule = css.match(/\.qa-region-table td:nth-child\(4\)\s*\{([^}]+)\}/)?.[1] ?? ''
expect(statusRule).toMatch(/white-space:\s*nowrap/)
})
it('shows a dated historical roster, conflicts and no invented performance verdict', () => {
const html = renderToStaticMarkup(<RegionMappingView {...props} />)
expect(html).toContain('历史快照')