How can I test if:true element in my lwc? showLoadingSpinner is @api. I am new to jest, sorry if stupid question. Console log shows null.
<template if:true={showLoadingSpinner}>
<div id="spinner">
<lightning-spinner class="slds-align_absolute-center" variant="brand" size="small" alternative-text="Loading.."></lightning-spinner>
</div>
</template>
test.js
const element = createElement('c-pagerLwc', { is: page });
document.body.appendChild(element);
element.showLoadingSpinner = true;
return Promise.resolve().then(() => {
let spinner = document.querySelector('#spinner');
console.log('spinner: ' + spinner);
expect(spinner).not.toBeNull();
});