I'm using puppeteer and jest to test some stuff on the front end, and I'm having a small issue - I think there is some concept I'm missing.
test("Assert that when checkbox isn't checked, dropdown menu is visible", async () => {
let checkbox = await page.$('input[ng-model="user.managed.timezone"]');
console.log("Checking if checkbox checked");
console.log("CHECKED: ", checkbox.checked);
});
According to the puppeteer docs, page.$ runs document.querySelector. When I run the following on the browser, I get what I want:
let m = document.querySelector('input[ng-model="user.managed.timezone"]')
console.log(m.checked) // results in true or false
but the code in jest results in CHECKED: undefined
Why is this the case --> what concept am I missing?