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

@ -100,15 +100,14 @@ describe('<App/>', function () {
const wrapper = shallow(<App/>); const wrapper = shallow(<App/>);
const func = jest.fn();
wrapper.instance().setState = func;
expect(global.fetch).toBeCalledTimes(1); expect(global.fetch).toBeCalledTimes(1);
process.nextTick(() => { process.nextTick(() => {
console.log(wrapper.state()); expect(func).toBeCalledTimes(1);
// todo state lifecycle not triggered
wrapper.update();
console.log(wrapper.state());
expect(wrapper.state('passwordsupport')).toBe(true);
global.fetch.mockClear(); global.fetch.mockClear();
done(); done();