config.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. lastOrganization: null,
  27. gravatarBaseUrl: 'https://gravatar.com',
  28. initialTrace: {
  29. baggage: 'baggage',
  30. sentry_trace: 'sentry_trace',
  31. },
  32. dsn: 'test-dsn',
  33. userIdentity: {
  34. ip_address: '127.0.0.1',
  35. email: 'example@example.com',
  36. id: '1',
  37. isStaff: false,
  38. },
  39. isAuthenticated: true,
  40. version: {
  41. current: '1.0.0-dev',
  42. latest: '1.0.0-dev',
  43. build: 'test-build',
  44. upgradeAvailable: false,
  45. },
  46. sentryConfig: {
  47. dsn: 'test-dsn',
  48. release: '1.0.0.-dev',
  49. allowUrls: [],
  50. tracePropagationTargets: [],
  51. },
  52. distPrefix: '',
  53. disableU2FForSUForm: false,
  54. apmSampling: 1,
  55. demoMode: false,
  56. customerDomain: {
  57. subdomain: 'foobar',
  58. organizationUrl: 'https://foobar.sentry.io',
  59. sentryUrl: 'https://sentry.io',
  60. },
  61. links: {
  62. sentryUrl: 'https://sentry.io',
  63. organizationUrl: 'https://foobar.sentry.io',
  64. regionUrl: 'https://us.sentry.io',
  65. },
  66. memberRegions: [{name: 'us', url: 'https://sentry.io'}],
  67. regions: [{name: 'us', url: 'https://sentry.io'}],
  68. ...params,
  69. };
  70. }