organizationCreate.spec.jsx 1.1 KB

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