adminSettings.spec.tsx 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. import {render} from 'sentry-test/reactTestingLibrary';
  2. import AdminSettings from 'sentry/views/admin/adminSettings';
  3. // TODO(dcramer): this doesnt really test anything as we need to
  4. // mock the API Response/wait on it
  5. describe('AdminSettings', function () {
  6. describe('render()', function () {
  7. beforeEach(() => {
  8. MockApiClient.addMockResponse({
  9. url: '/internal/options/',
  10. body: {
  11. 'system.url-prefix': {
  12. field: {
  13. disabledReason: 'diskPriority',
  14. default: '',
  15. required: true,
  16. disabled: true,
  17. allowEmpty: true,
  18. isSet: true,
  19. },
  20. value: 'https://sentry.example.com',
  21. },
  22. 'system.admin-email': {
  23. field: {
  24. disabledReason: 'diskPriority',
  25. default: null,
  26. required: true,
  27. disabled: true,
  28. allowEmpty: false,
  29. isSet: true,
  30. },
  31. value: 'foo@example.com',
  32. },
  33. 'system.support-email': {
  34. field: {
  35. disabledReason: 'diskPriority',
  36. default: null,
  37. required: true,
  38. disabled: true,
  39. allowEmpty: false,
  40. isSet: true,
  41. },
  42. value: 'foo@example.com',
  43. },
  44. 'system.security-email': {
  45. field: {
  46. disabledReason: 'diskPriority',
  47. default: null,
  48. required: true,
  49. disabled: true,
  50. allowEmpty: false,
  51. isSet: true,
  52. },
  53. value: 'foo@example.com',
  54. },
  55. 'system.rate-limit': {
  56. field: {
  57. disabledReason: 'diskPriority',
  58. default: 0,
  59. required: true,
  60. disabled: true,
  61. allowEmpty: false,
  62. isSet: true,
  63. },
  64. value: 25,
  65. },
  66. 'auth.allow-registration': {
  67. field: {
  68. disabledReason: 'diskPriority',
  69. default: false,
  70. required: true,
  71. disabled: true,
  72. allowEmpty: false,
  73. isSet: true,
  74. },
  75. value: true,
  76. },
  77. 'auth.ip-rate-limit': {
  78. field: {
  79. disabledReason: 'diskPriority',
  80. default: 0,
  81. required: true,
  82. disabled: true,
  83. allowEmpty: false,
  84. isSet: true,
  85. },
  86. value: 25,
  87. },
  88. 'auth.user-rate-limit': {
  89. field: {
  90. disabledReason: 'diskPriority',
  91. default: 0,
  92. required: true,
  93. disabled: true,
  94. allowEmpty: false,
  95. isSet: true,
  96. },
  97. value: 25,
  98. },
  99. 'api.rate-limit.org-create': {
  100. field: {
  101. disabledReason: 'diskPriority',
  102. default: 0,
  103. required: true,
  104. disabled: true,
  105. allowEmpty: false,
  106. isSet: true,
  107. },
  108. value: 25,
  109. },
  110. },
  111. });
  112. });
  113. it('renders', function () {
  114. const wrapper = render(<AdminSettings />);
  115. expect(wrapper.container).toSnapshot();
  116. });
  117. });
  118. });