mock-account.ts 489 B

12345678910111213141516
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { useSessionStore } from '#shared/stores/session.ts'
  3. import type { UserData } from '#shared/types/store.ts'
  4. import { initializePiniaStore } from './components/renderComponent.ts'
  5. export const mockAccount = (mockUser: Partial<UserData>) => {
  6. initializePiniaStore()
  7. const user = useSessionStore()
  8. user.user = {
  9. id: '123',
  10. internalId: 1,
  11. objectAttributeValues: [],
  12. ...mockUser,
  13. }
  14. }