| | |
| | | buildRoleSavePayload, |
| | | buildRoleScopeSubmitPayload, |
| | | buildRoleSearchParams, |
| | | getRolePaginationKey, |
| | | getRoleScopeConfig, |
| | | normalizeRoleScopeTreeData, |
| | | normalizeRoleListRow, |
| | |
| | | ) |
| | | const roleIndexSource = fs.readFileSync( |
| | | new URL('../src/views/system/role/index.vue', import.meta.url), |
| | | 'utf8' |
| | | ) |
| | | const roleTableColumnsSource = fs.readFileSync( |
| | | new URL('../src/views/system/role/roleTable.columns.js', import.meta.url), |
| | | 'utf8' |
| | | ) |
| | | |
| | |
| | | name: '管理员' |
| | | } |
| | | ) |
| | | }) |
| | | |
| | | test('role page uses backend pageSize pagination key', () => { |
| | | assert.deepEqual(getRolePaginationKey(), { |
| | | current: 'current', |
| | | size: 'pageSize' |
| | | }) |
| | | }) |
| | | |
| | | test('buildRoleDialogModel normalizes backend role data into the form model', () => { |
| | |
| | | assert.match(roleIndexSource, /v-auth=\"'add'\"/) |
| | | assert.match(roleIndexSource, /v-auth=\"'delete'\"/) |
| | | assert.match(roleIndexSource, /v-auth=\"'query'\"/) |
| | | assert.match(roleIndexSource, /auth: 'edit'/) |
| | | assert.match(roleIndexSource, /auth: 'delete'/) |
| | | assert.match(roleTableColumnsSource, /auth: 'edit'/) |
| | | assert.match(roleTableColumnsSource, /auth: 'delete'/) |
| | | }) |
| | | |
| | | test('createRoleSearchState exposes the role search form model', () => { |