fixing failing test

This commit is contained in:
Lukas Heiligenbrunner 2020-07-16 19:13:54 +02:00
parent b9b9ac0bc2
commit 8b89db6d5c
2 changed files with 6 additions and 7 deletions

View File

@ -42,7 +42,7 @@ class App extends React.Component {
newElement = null;
constructViewBinding(){
constructViewBinding() {
return {
changeRootElement: this.changeRootElement,
returnToLastElement: this.returnToLastElement

View File

@ -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();