import {shallow} from 'enzyme'; import React from 'react'; import {NoBackendConnectionPopup} from './NoBackendConnectionPopup'; import {getBackendDomain} from '../../../utils/Api'; describe('', function () { it('renders without crashing ', function () { const wrapper = shallow( {}}/>); wrapper.unmount(); }); it('hides on refresh click', function () { const func = jest.fn(); const wrapper = shallow(); expect(func).toBeCalledTimes(0); wrapper.find('button').simulate('click'); expect(func).toBeCalledTimes(1); }); it('simulate change of textfield', function () { const wrapper = shallow( {}}/>); wrapper.find('input').simulate('change', {target: {value: 'testvalue'}}); expect(getBackendDomain()).toBe('testvalue'); }); });