In this case, you have a public property (patient
) that would be getting set, in real-world usage, on creation.
Your current test creates the element first, with no patient
value defined which is why you run into an error when renderedCallback
expects there to be patient info to focus on.
You need to set the @api variable before creating your element.
element.patient = PATIENT_MOCK;
document.body.appendChild(element);
//mock wire and wait for DOM updates to assert
getUserInfo.emit(USER_MOCK);
return Promise.resolve().then(() => {});