organizationApiKeyDetailsView.spec.jsx 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import * as PropTypes from 'prop-types';
  2. import {mountWithTheme} from 'sentry-test/enzyme';
  3. import OrganizationApiKeyDetails from 'sentry/views/settings/organizationApiKeys/organizationApiKeyDetails';
  4. const childContextTypes = {
  5. organization: PropTypes.object,
  6. router: PropTypes.object,
  7. location: PropTypes.object,
  8. };
  9. describe('OrganizationApiKeyDetails', function () {
  10. beforeEach(function () {
  11. MockApiClient.clearMockResponses();
  12. MockApiClient.addMockResponse({
  13. url: '/organizations/org-slug/api-keys/1/',
  14. method: 'GET',
  15. body: TestStubs.ApiKey(),
  16. });
  17. });
  18. it('renders', function () {
  19. const wrapper = mountWithTheme(
  20. <OrganizationApiKeyDetails params={{apiKey: 1, orgId: 'org-slug'}} />,
  21. {
  22. context: {
  23. router: TestStubs.router(),
  24. organization: TestStubs.Organization(),
  25. location: TestStubs.location(),
  26. },
  27. childContextTypes,
  28. }
  29. );
  30. expect(wrapper.find('LoadingIndicator')).toHaveLength(0);
  31. expect(wrapper).toSnapshot();
  32. });
  33. });