mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Fix UT
This commit is contained in:
parent
57a88706a1
commit
8c0ae96edc
@ -32,6 +32,7 @@ exports[`screen picker should render correctly 1`] = `
|
||||
</div>
|
||||
<div
|
||||
className="ScreenPicker-error-content"
|
||||
key="spec"
|
||||
>
|
||||
<span
|
||||
className="error-message"
|
||||
|
@ -9,6 +9,10 @@ describe('basic auth', () => {
|
||||
const passwordTargetMock: object = {
|
||||
target: { id: 'password', value: '123456' },
|
||||
};
|
||||
const defaultState: object = {
|
||||
hostname: 'unknown',
|
||||
isValidCredentials: true,
|
||||
};
|
||||
const basicAuthMock: object = {
|
||||
hostname: 'example',
|
||||
isValidCredentials: true,
|
||||
@ -27,9 +31,13 @@ describe('basic auth', () => {
|
||||
const spy: jest.SpyInstance = jest.spyOn(BasicAuth.prototype, 'setState');
|
||||
const wrapper: ShallowWrapper = shallow(React.createElement(BasicAuth));
|
||||
wrapper.find('#username').simulate('change', usernameTargetMock);
|
||||
expect(spy).lastCalledWith(usernameMock);
|
||||
expect(spy).lastCalledWith({ ...defaultState, ...usernameMock });
|
||||
wrapper.find('#password').simulate('change', passwordTargetMock);
|
||||
expect(spy).lastCalledWith(passwordMock);
|
||||
expect(spy).lastCalledWith({
|
||||
...defaultState,
|
||||
...usernameMock,
|
||||
...passwordMock,
|
||||
});
|
||||
});
|
||||
|
||||
it('should call submit login', () => {
|
||||
|
@ -205,7 +205,7 @@ export default class ScreenPicker extends React.Component<{}, IState> {
|
||||
this.isApplicationsAvailable = applications.length > 0;
|
||||
if (!this.isScreensAvailable && !this.isApplicationsAvailable) {
|
||||
return (
|
||||
<div className='ScreenPicker-error-content'>
|
||||
<div className='ScreenPicker-error-content' key='spec'>
|
||||
<span className='error-message'>
|
||||
{i18n.t(
|
||||
'No screens or applications are currently available.',
|
||||
@ -217,7 +217,7 @@ export default class ScreenPicker extends React.Component<{}, IState> {
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='ScreenPicker-main-content'>
|
||||
<div className='ScreenPicker-main-content' key='spmc'>
|
||||
{this.renderTabTitles()}
|
||||
<section id='screen-contents'>{screens}</section>
|
||||
<section id='application-contents'> {applications}</section>
|
||||
|
Loading…
Reference in New Issue
Block a user