Files
crawler-plugin/admin-frontend-vue/tests/align-message-z-overlay.test.ts
T

35 lines
1.6 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import test from 'node:test'
import assert from 'node:assert/strict'
import { readSource } from './helpers.ts'
// 维护修复:页面自定义 modal-mask(z-index:3000) / 导出等待遮罩(3100) 高于 Element 默认
// 弹层计数(自 2000 递增),遮罩弹窗内触发的 ElMessage 警告会被浮层挡住看不见——
// 已在整站层面把消息提示抬到 4000、消息盒确认弹窗抬到 4100,统一高于全部自定义浮层。
test('el_message_above_custom_overlays', () => {
const css = readSource('src/styles/main.css')
assert.match(
css,
/\.el-message\s*\{[^}]*z-index:\s*4000\s*!important/,
'消息提示需抬升到 4000 且 !important(覆盖 Element 实例内联层级)',
)
assert.match(
css,
/\.el-overlay\.is-message-box\s*\{[^}]*z-index:\s*4100\s*!important/,
'消息盒确认弹窗需抬升到 4100z-index 落在 .el-overlay.is-message-box 内联样式)',
)
})
test('dedupe_overlay_and_warning_kept', () => {
const page = readSource('src/pages/asin/DedupeRegistryPage.vue')
assert.match(page, /\.modal-mask\s*\{[^}]*z-index:\s*3000/, '页内遮罩仍为 3000,消息 4000 需保持在其上')
assert.match(page, /\.dedupe-export-wait-mask\s*\{[^}]*z-index:\s*3100/, '导出等待遮罩 3100 同样低于消息 4000')
assert.match(page, /请选择数据权限分组|请选择分组/, '导入/编辑未选分组需保留警告岔口')
})
test('records_preview_overlay_below_message', () => {
const page = readSource('src/pages/records/RecordsHistoryPage.vue')
assert.match(page, /\.modal-mask\s*\{[^}]*z-index:\s*3000/, '记录预览遮罩 3000 同样低于消息 4000')
})