0

in below componentWillMount func i am using window.location.hash, so how i provide this value while testing in jest.

componentWillMount() {
    console.log("component willmount")
    const { getframeworkdatabypath } = this.props;
    let location = window.location.hash;
    console.log("window.locaton hash ",window.location.hash);
    console.log("location ",location);

    location = location.replace("#", '');

    var dataLocation = {
        type: "catalogCurrentPageURL",
        value: location,
    }; 
		
	console.log("store and constants ",Store,constants);
    let dispathreturn = Store.dispatch({
        type: constants.CATALOG_CURRENT_PAGE_URL,
        params: dataLocation
    })
    console.log("dispathreturn",dispathreturn)
    getframeworkdatabypath(location);
}

4

0 回答 0