feat: roles SPA foundations
This commit is contained in:
1 parent
80f7037d3a
commit
907949aa12
180 files changed
+4308
-835
No files matched your search
@@ -10,6 +10,8 @@ import type { MediaItem } from '@/composables/useMedia'
|
||||
import { useSessionStore } from '@/stores/session'
|
||||
import { DESKTOP_WIDTH, setViewportWidth } from '@/components/__tests__/viewport'
|
||||
import MediaView from '../MediaView.vue'
|
||||
import type { Access } from '@/lib/permissions'
|
||||
import { accessFor, ownerAccess } from '@/test/access'
|
||||
|
||||
type Row = [
|
||||
number,
|
||||
@@ -392,7 +394,7 @@ export async function mountPage(
|
||||
handlers: Handlers = {},
|
||||
url = '/media',
|
||||
width = DESKTOP_WIDTH,
|
||||
options: { realApi?: boolean; role?: string; app?: boolean } = {},
|
||||
options: { realApi?: boolean; role?: string; access?: Access; app?: boolean } = {},
|
||||
) {
|
||||
setViewportWidth(width)
|
||||
setActivePinia(createPinia())
|
||||
@@ -402,7 +404,7 @@ export async function mountPage(
|
||||
username: 'marta',
|
||||
id: 1,
|
||||
displayName: '',
|
||||
role: (options.role ?? 'owner') as never,
|
||||
access: options.access ?? accessFor(options.role ?? 'owner'),
|
||||
}
|
||||
session.status = 'ready'
|
||||
const dispatch = dispatcher(handlers)
|
||||
@@ -414,6 +416,7 @@ export async function mountPage(
|
||||
vi.mocked(useApi).mockReturnValue({
|
||||
getMe: vi.fn().mockResolvedValue({
|
||||
verified: true,
|
||||
access: ownerAccess(),
|
||||
username: 'marta',
|
||||
id: 1,
|
||||
}),
|
||||
|
||||
Reference in new issue
Block a user