zhou zhou
2 天以前 3fdcf1d5e6468c735532e67bde5ff1cdf85bb0c6
rsf-design/tests/system-role-scope-contract.test.mjs
@@ -8,6 +8,7 @@
  buildRoleSavePayload,
  buildRoleScopeSubmitPayload,
  buildRoleSearchParams,
  getRolePaginationKey,
  getRoleScopeConfig,
  normalizeRoleScopeTreeData,
  normalizeRoleListRow,
@@ -25,6 +26,10 @@
)
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'
)
@@ -60,6 +65,13 @@
      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', () => {
@@ -196,8 +208,8 @@
  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', () => {