You may have more luck with the checked attribute instead of state
.
cy.get('[id=input1]')
.invoke('attr', 'checked')
.then((checked) => {
if (checked) {
console.log('checked')
}
else {
console.log('not checked')
}
})