homehub/packages/homehub_core/tests/lib/dashboards.spec.js

24 lines
633 B
JavaScript
Raw Normal View History

2021-08-26 10:33:15 +00:00
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');
});
});
});