30 lines
1.2 KiB
TypeScript
30 lines
1.2 KiB
TypeScript
import test from 'node:test'
|
||
import assert from 'node:assert/strict'
|
||
import { readSource } from './helpers.ts'
|
||
|
||
/** 对齐旧版 .btn-sm:account 域行内操作统一实心小按钮(不再 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')
|
||
})
|