config.ts 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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: null,
  58. links: {
  59. sentryUrl: "https://sentry.io",
  60. organizationUrl: undefined,
  61. regionUrl: undefined,
  62. },
  63. memberRegions: [{name: 'us', url: 'https://sentry.io'}],
  64. regions: [{name: 'us', url: 'https://sentry.io'}],
  65. ...params,
  66. };
  67. }