fixing failing test
This commit is contained in:
		@@ -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();
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user