getRouteStringFromRoutes.spec.tsx 542 B

12345678910111213141516
  1. import getRouteStringFromRoutes from 'sentry/utils/getRouteStringFromRoutes';
  2. describe('getRouteStringFromRoutes', function () {
  3. const routes = [
  4. {path: '/'},
  5. {path: '/:orgId/'},
  6. {name: 'this should be skipped'},
  7. {path: '/organizations/:orgId/'},
  8. {name: 'also skipped'},
  9. {path: 'api-keys/', name: 'API Key'},
  10. ];
  11. it('can get a route string from routes array and skips routes that do not have a path', function () {
  12. expect(getRouteStringFromRoutes(routes)).toBe('/organizations/:orgId/api-keys/');
  13. });
  14. });