auditLogView.spec.jsx 846 B

1234567891011121314151617181920212223242526272829303132333435
  1. import React from 'react';
  2. import {mount} from 'enzyme';
  3. import {Client} from 'app/api';
  4. import AuditLogView from 'app/views/settings/organization/auditLog/auditLogView';
  5. jest.mock('jquery');
  6. describe('AuditLogView', function() {
  7. let org = TestStubs.Organization();
  8. const ENDPOINT = `/organizations/${org.slug}/audit-logs/`;
  9. beforeEach(function() {
  10. Client.clearMockResponses();
  11. Client.addMockResponse({
  12. url: ENDPOINT,
  13. body: TestStubs.AuditLogs(),
  14. });
  15. });
  16. it('renders', function(done) {
  17. let wrapper = mount(
  18. <AuditLogView location={{query: ''}} params={{orgId: org.slug}} />,
  19. TestStubs.routerContext()
  20. );
  21. wrapper.setState({loading: false});
  22. wrapper.update();
  23. setTimeout(() => {
  24. wrapper.update();
  25. expect(wrapper).toMatchSnapshot();
  26. done();
  27. });
  28. });
  29. });