delete useless custombackend popup
correct load of subpage when standalone binary ability to set external videourl when using standalone binary
This commit is contained in:
@ -1,29 +0,0 @@
|
||||
import {shallow} from 'enzyme';
|
||||
import React from 'react';
|
||||
import {NoBackendConnectionPopup} from './NoBackendConnectionPopup';
|
||||
import {getBackendDomain} from '../../../utils/Api';
|
||||
|
||||
describe('<NoBackendConnectionPopup/>', function () {
|
||||
it('renders without crashing ', function () {
|
||||
const wrapper = shallow(<NoBackendConnectionPopup onHide={() => {}}/>);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('hides on refresh click', function () {
|
||||
const func = jest.fn();
|
||||
const wrapper = shallow(<NoBackendConnectionPopup onHide={func}/>);
|
||||
|
||||
expect(func).toBeCalledTimes(0);
|
||||
wrapper.find('button').simulate('click');
|
||||
|
||||
expect(func).toBeCalledTimes(1);
|
||||
});
|
||||
|
||||
it('simulate change of textfield', function () {
|
||||
const wrapper = shallow(<NoBackendConnectionPopup onHide={() => {}}/>);
|
||||
|
||||
wrapper.find('input').simulate('change', {target: {value: 'testvalue'}});
|
||||
|
||||
expect(getBackendDomain()).toBe('testvalue');
|
||||
});
|
||||
});
|
@ -1,27 +0,0 @@
|
||||
import React from 'react';
|
||||
import PopupBase from '../PopupBase';
|
||||
import style from '../NewActorPopup/NewActorPopup.module.css';
|
||||
import {setCustomBackendDomain} from '../../../utils/Api';
|
||||
|
||||
interface NBCProps {
|
||||
onHide: (_: void) => void;
|
||||
}
|
||||
|
||||
export function NoBackendConnectionPopup(props: NBCProps): JSX.Element {
|
||||
return (
|
||||
<PopupBase title='No connection to backend API!' onHide={props.onHide} height='200px' width='600px'>
|
||||
<div>
|
||||
<input
|
||||
type='text'
|
||||
placeholder='http://192.168.0.2'
|
||||
onChange={(v): void => {
|
||||
setCustomBackendDomain(v.target.value);
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<button className={style.savebtn} onClick={(): void => props.onHide()}>
|
||||
Refresh
|
||||
</button>
|
||||
</PopupBase>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user