mirror of
https://github.com/finos/SymphonyElectron.git
synced 2025-02-25 18:55:29 -06:00
Fix UT
This commit is contained in:
committed by
Salah Benmoussati
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', () => {
|
||||
|
||||
Reference in New Issue
Block a user