config.ts 1.8 KB

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