I think one of the first things I'd do is change the name of the function to "setTargetMonth" because you're not actually returning anything. I'd also change the name of the variable "div" because a div is an element, not an integer. Try using something more descriptive. I think once you fix those two things the next thing you can do is probably remove the cy.then(() => {}). I'm not sure that's necessary. There's still a lot of missing context to what you're trying to do. We still don't know what "div" is supposed to represent other than the fact that it's an integer.