优化
This commit is contained in:
@@ -114,7 +114,8 @@ describe('AppLayout', () => {
|
||||
|
||||
it('shows the authenticated identity and the localhost full-access control', async () => {
|
||||
const { wrapper } = await mountLayout()
|
||||
expect(wrapper.text()).toContain('登录身份:平台管理员(admin)')
|
||||
expect(wrapper.get('.user-copy').text()).toBe('平台管理员(admin)')
|
||||
expect(wrapper.get('.user-copy').attributes('aria-label')).toBe('登录身份:平台管理员(admin)')
|
||||
const accessToggle = wrapper.get('[role="switch"]')
|
||||
expect(accessToggle.text()).toContain('本地全权限')
|
||||
expect(accessToggle.text()).toContain('已关闭')
|
||||
@@ -130,10 +131,29 @@ describe('AppLayout', () => {
|
||||
expect(notificationTrigger.find('.notification-count').exists()).toBe(false)
|
||||
})
|
||||
|
||||
it('avoids repeating identical display names and accounts while retaining the full accessible identity', async () => {
|
||||
const { wrapper } = await mountLayout()
|
||||
const auth = useAuthStore()
|
||||
auth.user = { ...auth.user!, name: 'admin', account: 'admin' }
|
||||
await wrapper.vm.$nextTick()
|
||||
|
||||
expect(wrapper.get('.user-copy').text()).toBe('admin')
|
||||
expect(wrapper.get('.user-copy').attributes('aria-label')).toBe('登录身份:admin(admin)')
|
||||
expect(wrapper.get('.user-copy').attributes('title')).toBe('登录身份:admin(admin)')
|
||||
})
|
||||
|
||||
it('limits the shell theme to navigation and header instead of inheriting it into routed pages', async () => {
|
||||
const { wrapper } = await mountLayout('/customers')
|
||||
|
||||
expect(wrapper.get('.app-sidebar').classes()).toContain('admin-workbench')
|
||||
expect(wrapper.get('.app-header').classes()).toContain('admin-workbench')
|
||||
expect(wrapper.get('.cached-count').element.closest('.admin-workbench')).toBeNull()
|
||||
})
|
||||
|
||||
it('hides the shell heading when the route opts out', async () => {
|
||||
const { wrapper } = await mountLayout('/customers')
|
||||
expect(wrapper.find('.page-heading').exists()).toBe(false)
|
||||
expect(wrapper.text()).toContain('登录身份:平台管理员(admin)')
|
||||
expect(wrapper.get('.user-copy').attributes('aria-label')).toBe('登录身份:平台管理员(admin)')
|
||||
})
|
||||
|
||||
it('logs out after confirmation', async () => {
|
||||
|
||||
Reference in New Issue
Block a user