organizationCreate.spec.jsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import React from 'react';
  2. import {shallow} from 'sentry-test/enzyme';
  3. import ConfigStore from 'app/stores/configStore';
  4. import OrganizationCreate from 'app/views/organizationCreate';
  5. describe('OrganizationCreate', function() {
  6. let privacyUrl, termsUrl;
  7. beforeEach(() => {
  8. termsUrl = ConfigStore.get('termsUrl', null);
  9. privacyUrl = ConfigStore.get('privacyUrl', null);
  10. });
  11. afterEach(() => {
  12. ConfigStore.set('termsUrl', termsUrl);
  13. ConfigStore.set('privacyUrl', privacyUrl);
  14. });
  15. describe('render()', function() {
  16. it('renders without terms', function() {
  17. ConfigStore.set('termsUrl', null);
  18. ConfigStore.set('privacyUrl', null);
  19. const wrapper = shallow(<OrganizationCreate />, {
  20. context: {router: TestStubs.router()},
  21. });
  22. expect(wrapper).toMatchSnapshot();
  23. });
  24. it('renders with terms', function() {
  25. ConfigStore.set('termsUrl', 'https://example.com/terms');
  26. ConfigStore.set('privacyUrl', 'https://example.com/privacy');
  27. const wrapper = shallow(<OrganizationCreate />, {
  28. context: {router: TestStubs.router()},
  29. });
  30. expect(wrapper).toMatchSnapshot();
  31. });
  32. });
  33. });