fixing failing test
This commit is contained in:
parent
b9b9ac0bc2
commit
8b89db6d5c
@ -42,7 +42,7 @@ class App extends React.Component {
|
||||
|
||||
newElement = null;
|
||||
|
||||
constructViewBinding(){
|
||||
constructViewBinding() {
|
||||
return {
|
||||
changeRootElement: this.changeRootElement,
|
||||
returnToLastElement: this.returnToLastElement
|
||||
|
@ -100,15 +100,14 @@ describe('<App/>', function () {
|
||||
|
||||
const wrapper = shallow(<App/>);
|
||||
|
||||
|
||||
const func = jest.fn();
|
||||
wrapper.instance().setState = func;
|
||||
|
||||
expect(global.fetch).toBeCalledTimes(1);
|
||||
|
||||
process.nextTick(() => {
|
||||
console.log(wrapper.state());
|
||||
|
||||
// todo state lifecycle not triggered
|
||||
wrapper.update();
|
||||
console.log(wrapper.state());
|
||||
expect(wrapper.state('passwordsupport')).toBe(true);
|
||||
expect(func).toBeCalledTimes(1);
|
||||
|
||||
global.fetch.mockClear();
|
||||
done();
|
||||
|
Loading…
Reference in New Issue
Block a user