SharePublicDashboardUtils.test.tsx 590 B

1234567891011121314151617
  1. import { DashboardModel } from 'app/features/dashboard/state';
  2. import { dashboardCanBePublic } from './SharePublicDashboardUtils';
  3. describe('dashboardCanBePublic', () => {
  4. it('can be public with no template variables', () => {
  5. //@ts-ignore
  6. const dashboard: DashboardModel = { templating: { list: [] } };
  7. expect(dashboardCanBePublic(dashboard)).toBe(true);
  8. });
  9. it('cannot be public with template variables', () => {
  10. //@ts-ignore
  11. const dashboard: DashboardModel = { templating: { list: [{}] } };
  12. expect(dashboardCanBePublic(dashboard)).toBe(false);
  13. });
  14. });