homehub/packages/homehub_app/tests/main/components/DummyWidget.spec.js
2021-08-26 12:33:15 +02:00

24 lines
662 B
JavaScript

import {shallow} from 'enzyme';
import React from 'react';
import * as DummyWidget from 'src/main/components/DummyWidget';
import {UptimeService} from 'src/services/uptime';
describe('src/main/components/DummyWidget', () => {
describe('DummyWidget', () => {
it('renders the service information', () => {
// Given
const service = new UptimeService({instance: 'testing'});
const component = shallow(
<DummyWidget.DummyWidget service={service} />
);
// When
const code = component.find('code').at(0);
// Then
expect(code.text()).toEqual(`${service.widget} (${service.instance})`);
});
});
});