I am unable to hit these lines of code even after I added some jest-mocks to my test folder. I am sure that I would have to do something like below, but how would I then hit it to verify what is inside the if statement?
let mockCurrentPageReference = {
type: "standard__navItemPage",
attributes: {
apiName: "Wire"
},
state: {
c__mediaId: "mediaId"
}
};
currentPageReferenceAdapter.emit(mockCurrentPageReference);
JavaScript:
@wire(CurrentPageReference)
wiredPageReference(currentPageReference){
if(currentPageReference){
this.currentPageRefernce = currentPageReference;
this.mediaId = this.currentPageRefernce.state.c__mediaId;
}
}