utils.test.ts 949 B

123456789101112131415161718192021222324252627
  1. import { isSoloRoute } from './utils';
  2. describe('isSoloRoute', () => {
  3. describe('when called with a solo route', () => {
  4. it('then it should return true', () => {
  5. expect(
  6. isSoloRoute(
  7. 'http://localhost:3000/render/d-solo/4vEk45n7k/dash?orgId=1&from=1629329071059&to=1629350671060&panelId=5&width=1000&height=500&tz=Europe%2FStockholm'
  8. )
  9. ).toBe(true);
  10. });
  11. it('then it should return true for a dashboard-solo route', () => {
  12. expect(
  13. isSoloRoute(
  14. 'http://localhost:3000/render/dashboard-solo/4vEk45n7k/dash?orgId=1&from=1629329071059&to=1629350671060&panelId=5&width=1000&height=500&tz=Europe%2FStockholm'
  15. )
  16. ).toBe(true);
  17. });
  18. });
  19. describe('when called without a solo route', () => {
  20. it('then it should return false', () => {
  21. expect(isSoloRoute('http://localhost:3000/d/4vEk45n7k/the-variables-system?orgId=1')).toBe(false);
  22. });
  23. });
  24. });