homehub/packages/homehub_core/tests/lib/dashboards.spec.js
2021-08-26 12:33:15 +02:00

24 lines
633 B
JavaScript

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');
});
});
});