The page has a checkbox, which is selected by default and binds the click event. Use event.target.checked in the event's callback function to check the latest value of the checkbox.
The user clicks the checkbox with the mouse, and in the callback function, the value of event.target.checked is false, no problem.
In Jasmine, if jQuery is used to trigger the click event, in the callback function, the value of event.target.checked is true. After the callback function is executed, the checkbox becomes unchecked.
Solution:
Use document.getElementById to get the checkbox, and then trigger the click event to get the correct value in the callback function.
References:
https://bugs.jquery.com/ticket/3827#comment:9