organizationApiKeyDetails.spec.tsx 933 B

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