优化
This commit is contained in:
@@ -60,6 +60,7 @@ function mockViewport(isMobile: boolean) {
|
||||
|
||||
describe('AppLayout', () => {
|
||||
beforeEach(() => {
|
||||
window.localStorage.clear()
|
||||
vi.mocked(ElMessageBox.confirm).mockReset()
|
||||
mockViewport(false)
|
||||
})
|
||||
@@ -111,10 +112,16 @@ describe('AppLayout', () => {
|
||||
expect(mediaQuery.removeEventListener).toHaveBeenCalledWith('change', changeHandler)
|
||||
})
|
||||
|
||||
it('shows the authenticated identity without a role preview switcher', async () => {
|
||||
it('shows the authenticated identity and the localhost full-access control', async () => {
|
||||
const { wrapper } = await mountLayout()
|
||||
expect(wrapper.text()).toContain('登录身份:平台管理员(admin)')
|
||||
expect(wrapper.text()).not.toContain('权限预览')
|
||||
const accessToggle = wrapper.get('[role="switch"]')
|
||||
expect(accessToggle.text()).toContain('本地全权限')
|
||||
expect(accessToggle.text()).toContain('已关闭')
|
||||
expect(accessToggle.attributes('aria-checked')).toBe('false')
|
||||
await accessToggle.trigger('click')
|
||||
expect(accessToggle.text()).toContain('已开启')
|
||||
expect(accessToggle.attributes('aria-checked')).toBe('true')
|
||||
expect(wrapper.get('[aria-label="消息中心"]').attributes('disabled')).toBeUndefined()
|
||||
expect(wrapper.text()).toContain('消息管理')
|
||||
expect(wrapper.text()).toContain('模板管理')
|
||||
|
||||
Reference in New Issue
Block a user