优化
This commit is contained in:
@@ -15,13 +15,13 @@ describe('server access store', () => {
|
||||
|
||||
expect(access.can('platform:warehouse:list')).toBe(true)
|
||||
expect(access.can('platform:user:list')).toBe(false)
|
||||
expect(access.firstAccessiblePath).toBe('/warehouses')
|
||||
expect(access.firstAccessiblePath).toBe('/dashboard')
|
||||
})
|
||||
|
||||
it('exposes no permissions when the server snapshot is empty', () => {
|
||||
it('keeps only the unprotected dashboard when the server snapshot is empty', () => {
|
||||
const access = useAccessPreviewStore()
|
||||
expect(access.permissionCodes.size).toBe(0)
|
||||
expect(access.filteredNavigation).toHaveLength(0)
|
||||
expect(access.firstAccessiblePath).toBeNull()
|
||||
expect(access.filteredNavigation).toHaveLength(1)
|
||||
expect(access.firstAccessiblePath).toBe('/dashboard')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user