user.tsx 967 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. import type {User} from 'sentry/types';
  2. export function UserFixture(params: Partial<User> = {}): User {
  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. defaultIssueEvent: 'recommended',
  15. avatarType: 'letter_avatar',
  16. stacktraceOrder: -1,
  17. },
  18. ip_address: '127.0.0.1',
  19. hasPasswordAuth: true,
  20. authenticators: [],
  21. canReset2fa: false,
  22. dateJoined: '2020-01-01T00:00:00.000Z',
  23. emails: [],
  24. experiments: [],
  25. has2fa: false,
  26. identities: [],
  27. isActive: false,
  28. isManaged: false,
  29. isStaff: false,
  30. isSuperuser: false,
  31. lastActive: '2020-01-01T00:00:00.000Z',
  32. lastLogin: '2020-01-01T00:00:00.000Z',
  33. permissions: new Set(),
  34. flags: {
  35. newsletter_consent_prompt: false,
  36. },
  37. ...params,
  38. };
  39. }