user.tsx 940 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import type {User as UserType} from 'sentry/types';
  2. export function User(params: Partial<UserType> = {}): UserType {
  3. return {
  4. id: '1',
  5. username: 'foo@example.com',
  6. email: 'foo@example.com',
  7. name: 'Foo Bar',
  8. isAuthenticated: true,
  9. options: {
  10. clock24Hours: false,
  11. timezone: 'UTC',
  12. language: 'en',
  13. theme: 'system',
  14. avatarType: 'letter_avatar',
  15. stacktraceOrder: -1,
  16. },
  17. ip_address: '127.0.0.1',
  18. hasPasswordAuth: true,
  19. authenticators: [],
  20. canReset2fa: false,
  21. dateJoined: '2020-01-01T00:00:00.000Z',
  22. emails: [],
  23. experiments: [],
  24. has2fa: false,
  25. identities: [],
  26. isActive: false,
  27. isManaged: false,
  28. isStaff: false,
  29. isSuperuser: false,
  30. lastActive: '2020-01-01T00:00:00.000Z',
  31. lastLogin: '2020-01-01T00:00:00.000Z',
  32. permissions: new Set(),
  33. flags: {
  34. newsletter_consent_prompt: false,
  35. },
  36. ...params,
  37. };
  38. }