configStore.spec.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import ConfigStore from 'sentry/stores/configStore';
  2. describe('ConfigStore', () => {
  3. it('should have apiUrl and organizationUrl', () => {
  4. const links = ConfigStore.get('links');
  5. expect(links).toEqual({
  6. organizationUrl: 'https://foobar.sentry.io',
  7. regionUrl: 'https://us.sentry.io',
  8. sentryUrl: 'https://sentry.io',
  9. });
  10. });
  11. it('should have cookie names', () => {
  12. const csrfCookieName = ConfigStore.get('csrfCookieName');
  13. expect(csrfCookieName).toEqual('csrf-test-cookie');
  14. const superUserCookieName = ConfigStore.get('superUserCookieName');
  15. expect(superUserCookieName).toEqual('su-test-cookie');
  16. });
  17. it('should have customerDomain', () => {
  18. const customerDomain = ConfigStore.get('customerDomain');
  19. expect(customerDomain).toEqual({
  20. subdomain: 'foobar',
  21. organizationUrl: 'https://foobar.sentry.io',
  22. sentryUrl: 'https://sentry.io',
  23. });
  24. });
  25. it('returns a stable reference from getState()', () => {
  26. ConfigStore.set('theme', 'dark');
  27. const state = ConfigStore.getState();
  28. expect(Object.is(state, ConfigStore.getState())).toBe(true);
  29. });
  30. });