projectHpkpReports.spec.jsx 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import {mountWithTheme} from 'sentry-test/enzyme';
  2. import ProjectHpkpReports from 'sentry/views/settings/projectSecurityHeaders/hpkp';
  3. describe('ProjectHpkpReports', function () {
  4. const org = TestStubs.Organization();
  5. const project = TestStubs.Project();
  6. const url = `/projects/${org.slug}/${project.slug}/hpkp/`;
  7. beforeEach(function () {
  8. MockApiClient.clearMockResponses();
  9. MockApiClient.addMockResponse({
  10. url: `/projects/${org.slug}/${project.slug}/`,
  11. method: 'GET',
  12. body: [],
  13. });
  14. MockApiClient.addMockResponse({
  15. url: `/projects/${org.slug}/${project.slug}/keys/`,
  16. method: 'GET',
  17. body: [],
  18. });
  19. });
  20. it('renders', function () {
  21. const wrapper = mountWithTheme(
  22. <ProjectHpkpReports
  23. organization={org}
  24. project={project}
  25. {...TestStubs.routerProps({
  26. params: {orgId: org.slug, projectId: project.slug},
  27. location: TestStubs.location({pathname: url}),
  28. })}
  29. />
  30. );
  31. expect(wrapper).toSnapshot();
  32. });
  33. });