fix incorrect gui refresh if theme is changed
implement custom clientstore add new Password page if password is set force entering password to successfully receive the token add a new unsafe api call for init call only
This commit is contained in:
21
src/pages/AuthenticationPage/AuthenticationPage.test.js
Normal file
21
src/pages/AuthenticationPage/AuthenticationPage.test.js
Normal file
@ -0,0 +1,21 @@
|
||||
import React from 'react';
|
||||
import AuthenticationPage from './AuthenticationPage';
|
||||
import {shallow} from 'enzyme';
|
||||
|
||||
describe('<AuthenticationPage/>', function () {
|
||||
it('renders without crashing ', function () {
|
||||
const wrapper = shallow(<AuthenticationPage submit={() => {}}/>);
|
||||
wrapper.unmount();
|
||||
});
|
||||
|
||||
it('test button click', function () {
|
||||
let pass;
|
||||
const func = jest.fn((pwd) => {pass = pwd});
|
||||
const wrapper = shallow(<AuthenticationPage submit={func}/>);
|
||||
wrapper.setState({pwdText: 'testpwd'});
|
||||
wrapper.find('Button').simulate('click');
|
||||
|
||||
expect(func).toHaveBeenCalledTimes(1);
|
||||
expect(pass).toBe('testpwd');
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user