organizationApiKeyDetails.spec.tsx 920 B

123456789101112131415161718192021222324252627
  1. import {DeprecatedApiKeyFixture} from 'sentry-fixture/deprecatedApiKey';
  2. import {initializeOrg} from 'sentry-test/initializeOrg';
  3. import {render, screen} from 'sentry-test/reactTestingLibrary';
  4. import OrganizationApiKeyDetails from 'sentry/views/settings/organizationApiKeys/organizationApiKeyDetails';
  5. describe('OrganizationApiKeyDetails', function () {
  6. beforeEach(function () {
  7. MockApiClient.clearMockResponses();
  8. MockApiClient.addMockResponse({
  9. url: '/organizations/org-slug/api-keys/1/',
  10. method: 'GET',
  11. body: DeprecatedApiKeyFixture(),
  12. });
  13. });
  14. it('renders', function () {
  15. const {organization, routerContext, routerProps} = initializeOrg();
  16. render(<OrganizationApiKeyDetails {...routerProps} params={{apiKey: '1'}} />, {
  17. context: routerContext,
  18. organization,
  19. });
  20. expect(screen.queryByTestId('loading-indicator')).not.toBeInTheDocument();
  21. });
  22. });