config.ts 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import {UserFixture} from 'sentry-fixture/user';
  2. import type {Config} from 'sentry/types/system';
  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. shouldPreloadData: true,
  15. singleOrganization: false,
  16. enableAnalytics: true,
  17. urlPrefix: 'https://sentry-jest-tests.example.com/',
  18. needsUpgrade: false,
  19. supportEmail: 'support@sentry.io',
  20. invitesEnabled: false,
  21. privacyUrl: null,
  22. termsUrl: null,
  23. // Maintain isOnPremise key for backcompat (plugins?).
  24. isOnPremise: false,
  25. isSelfHosted: false,
  26. isSelfHostedErrorsOnly: false,
  27. lastOrganization: null,
  28. gravatarBaseUrl: 'https://gravatar.com',
  29. initialTrace: {
  30. baggage: 'baggage',
  31. sentry_trace: 'sentry_trace',
  32. },
  33. dsn: 'test-dsn',
  34. userIdentity: {
  35. ip_address: '127.0.0.1',
  36. email: 'example@example.com',
  37. id: '1',
  38. isStaff: false,
  39. },
  40. isAuthenticated: true,
  41. version: {
  42. current: '1.0.0-dev',
  43. latest: '1.0.0-dev',
  44. build: 'test-build',
  45. upgradeAvailable: false,
  46. },
  47. sentryConfig: {
  48. dsn: 'test-dsn',
  49. release: '1.0.0.-dev',
  50. allowUrls: [],
  51. tracePropagationTargets: [],
  52. },
  53. distPrefix: '',
  54. disableU2FForSUForm: false,
  55. apmSampling: 1,
  56. demoMode: false,
  57. customerDomain: {
  58. subdomain: 'foobar',
  59. organizationUrl: 'https://foobar.sentry.io',
  60. sentryUrl: 'https://sentry.io',
  61. },
  62. links: {
  63. sentryUrl: 'https://sentry.io',
  64. organizationUrl: 'https://foobar.sentry.io',
  65. regionUrl: 'https://us.sentry.io',
  66. },
  67. memberRegions: [{name: 'us', url: 'https://sentry.io'}],
  68. regions: [{name: 'us', url: 'https://sentry.io'}],
  69. ...params,
  70. };
  71. }