homehub/packages/homehub_app/tests/main/components/DummyWidget.spec.js

24 lines
662 B
JavaScript
Raw Permalink Normal View History

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