import * as DashboardsLib from 'src/lib/dashboards';

describe('src/lib/dashboards', () => {
  describe('DashboardFactory', () => {
    it('initializes the dashboard with defaults', () => {
      // Given
      const result = DashboardsLib.DashboardFactory();

      // Then
      expect(result.name).toEqual(jasmine.any(String));
      expect(result.id).toBeUUIDv4();
      expect(result.services).toEqual([]);
    });

    it('allows specifying an arbitrary name', () => {
      // Given
      const result = DashboardsLib.DashboardFactory('Testing');

      // Then
      expect(result.name).toEqual('Testing');
    });
  });
});
