优化
This commit is contained in:
@@ -500,6 +500,48 @@ describe('approved Admin density ownership', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('keeps measurement sections within the clipped panel and gives long references room', () => {
|
||||
const dialog = parse(read('modules/inbounds/measurement/InboundMeasurementDialog.vue')).descriptor
|
||||
const layout = read('modules/inbounds/measurement/measurementDensity.css')
|
||||
const summaryMargins: string[] = []
|
||||
for (const css of [layout, ...dialog.styles.map(style => style.content)]) {
|
||||
cssRoot(css).walkRules(rule => {
|
||||
if (!/\.measurement-(summary-section|declaration|items-section)(?![\w-])/.test(rule.selector)) return
|
||||
rule.walkDecls(decl => {
|
||||
if (decl.prop.startsWith('margin')) {
|
||||
expect(decl.value, `section must not escape the clipped panel: ${rule.selector}`).not.toMatch(/(^|\s)-\d/)
|
||||
if (rule.selector.endsWith('.measurement-summary-section')) summaryMargins.push(decl.value)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
expect(summaryMargins).toEqual(['0'])
|
||||
const sectionStyles = new Map<string, Record<string, string>>()
|
||||
cssRoot(layout).walkRules(rule => {
|
||||
const declarations: Record<string, string> = {}
|
||||
rule.walkDecls(decl => { declarations[decl.prop] = decl.value })
|
||||
sectionStyles.set(rule.selector, declarations)
|
||||
})
|
||||
for (const [section, background] of [
|
||||
['summary-section', '#f4fbf8'], ['declaration', '#f7f9ff'], ['items-section', '#fffbf4'],
|
||||
]) {
|
||||
expect(sectionStyles.get(`.inbound-measurement-workspace-dialog.inbound-density .measurement-${section}`)).toMatchObject({
|
||||
padding: 'var(--admin-space-4, 10px) var(--admin-space-5, 12px)',
|
||||
background,
|
||||
})
|
||||
}
|
||||
// Shared density must not reset the coloured sections' horizontal gutters.
|
||||
expect(sectionStyles.get('.inbound-density.admin-density-dialog .measurement-section')).toEqual({
|
||||
'padding-block': 'var(--admin-space-4, 10px)',
|
||||
})
|
||||
expect(layout).toContain('.measurement-document-number { display: flex; flex: 1;')
|
||||
expect(layout).toContain('.measurement-platform-fields { display: flex; flex: 1 1 520px;')
|
||||
expect(layout).toContain('.measurement-platform-fields > .measurement-expected-pallets { flex: 0 0 180px; }')
|
||||
for (const style of dialog.styles) {
|
||||
expect(style.content).not.toMatch(/\.measurement-(summary-section|metrics|declaration|items-section)\b/)
|
||||
}
|
||||
})
|
||||
|
||||
it('keeps desktop table toolbar dimensions owned by DataTable without cascade overrides', () => {
|
||||
const tableCss = parse(read('shared/components/DataTable.vue')).descriptor.styles.map(style => style.content).join('\n')
|
||||
const dimensions: Record<string, string[]> = { padding: [], 'min-height': [] }
|
||||
|
||||
Reference in New Issue
Block a user