organizationApiKeyDetails.spec.jsx 832 B

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