urls.spec.jsx 960 B

1234567891011121314151617181920
  1. import {getDiscoverLandingUrl} from 'sentry/utils/discover/urls';
  2. describe('getDiscoverLandingUrl', function () {
  3. it('is correct for with discover-query and discover-basic features', function () {
  4. const org = TestStubs.Organization({features: ['discover-query', 'discover-basic']});
  5. expect(getDiscoverLandingUrl(org)).toBe('/organizations/org-slug/discover/queries/');
  6. });
  7. it('is correct for with only discover-basic feature', function () {
  8. const org = TestStubs.Organization({features: ['discover-basic']});
  9. expect(getDiscoverLandingUrl(org)).toBe('/organizations/org-slug/discover/results/');
  10. });
  11. it('navigates to the results URL with the discover-query-builder-as-landing-page feature', function () {
  12. const org = TestStubs.Organization({
  13. features: ['discover-query', 'discover-query-builder-as-landing-page'],
  14. });
  15. expect(getDiscoverLandingUrl(org)).toBe('/organizations/org-slug/discover/results/');
  16. });
  17. });