mock-userCurrent.ts 500 B

1234567891011121314151617
  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 mockUserCurrent = (mockUser: Partial<UserData>) => {
  6. initializePiniaStore()
  7. const session = useSessionStore()
  8. session.user = {
  9. id: '123',
  10. internalId: 1,
  11. objectAttributeValues: [],
  12. ...mockUser,
  13. }
  14. }