align(account): 用户/菜单/分组行内操作统一实心 small 按钮(对齐旧版 .btn-sm),移除 link 形态

This commit is contained in:
2026-09-06 21:39:30 +08:00
parent 4742a2e3b5
commit 2691472a5e
4 changed files with 35 additions and 6 deletions
@@ -0,0 +1,29 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import { readSource } from './helpers.ts'
/** 对齐旧版 .btn-smaccount 域行内操作统一实心小按钮(不再 link/text)。 */
function assertRowButtonSolid(source: string, action: string) {
assert.match(source, new RegExp(`<el-button[^>]*size="small"[^>]*@click="${action}`), `${action} 为 size=small 实心按钮`)
assert.doesNotMatch(source, new RegExp(`<el-button[^>]*link[^>]*@click="${action}`), `${action} 不再 link`)
assert.doesNotMatch(source, new RegExp(`<el-button[^>]*text[^>]*@click="${action}`), `${action} 不再 text`)
}
test('align_users_row_buttons_solid', () => {
const s = readSource('src/pages/account/UsersPage.vue')
assertRowButtonSolid(s, 'openEdit')
assertRowButtonSolid(s, 'removeUser')
})
test('align_groups_row_buttons_solid', () => {
const s = readSource('src/pages/account/GroupsPage.vue')
assertRowButtonSolid(s, 'openEdit')
assertRowButtonSolid(s, 'removeGroup')
})
test('align_menus_row_buttons_solid', () => {
const s = readSource('src/pages/account/MenusPage.vue')
assertRowButtonSolid(s, 'openEdit')
assertRowButtonSolid(s, 'removeMenu')
})