config.tsx 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import {UserFixture} from 'sentry-fixture/user';
  2. import type {Config} from 'sentry/types';
  3. export function ConfigFixture(params: Partial<Config> = {}): Config {
  4. return {
  5. theme: 'light',
  6. user: UserFixture(),
  7. messages: [],
  8. languageCode: 'en',
  9. csrfCookieName: 'csrf-test-cookie',
  10. superUserCookieName: 'su-test-cookie',
  11. superUserCookieDomain: '.sentry.io',
  12. validateSUForm: true,
  13. features: new Set(),
  14. singleOrganization: false,
  15. enableAnalytics: true,
  16. urlPrefix: 'https://sentry-jest-tests.example.com/',
  17. needsUpgrade: false,
  18. supportEmail: 'support@sentry.io',
  19. invitesEnabled: false,
  20. privacyUrl: null,
  21. termsUrl: null,
  22. // Maintain isOnPremise key for backcompat (plugins?).
  23. isOnPremise: false,
  24. isSelfHosted: false,
  25. lastOrganization: null,
  26. gravatarBaseUrl: 'https://gravatar.com',
  27. initialTrace: {
  28. baggage: 'baggage',
  29. sentry_trace: 'sentry_trace',
  30. },
  31. dsn: 'test-dsn',
  32. userIdentity: {
  33. ip_address: '127.0.0.1',
  34. email: 'example@example.com',
  35. id: '1',
  36. isStaff: false,
  37. },
  38. isAuthenticated: true,
  39. version: {
  40. current: '1.0.0-dev',
  41. latest: '1.0.0-dev',
  42. build: 'test-build',
  43. upgradeAvailable: false,
  44. },
  45. sentryConfig: {
  46. dsn: 'test-dsn',
  47. release: '1.0.0.-dev',
  48. allowUrls: [],
  49. tracePropagationTargets: [],
  50. },
  51. distPrefix: '',
  52. disableU2FForSUForm: false,
  53. apmSampling: 1,
  54. demoMode: false,
  55. customerDomain: {
  56. subdomain: 'foobar',
  57. organizationUrl: 'https://foobar.sentry.io',
  58. sentryUrl: 'https://sentry.io',
  59. },
  60. links: {
  61. sentryUrl: 'https://sentry.io',
  62. organizationUrl: 'https://foobar.sentry.io',
  63. regionUrl: 'https://us.sentry.io',
  64. },
  65. memberRegions: [{name: 'us', url: 'https://sentry.io'}],
  66. regions: [{name: 'us', url: 'https://sentry.io'}],
  67. ...params,
  68. };
  69. }