adminSettings.spec.jsx 3.3 KB

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