To summarize what we found in the comments above, it seems as though the DOM isn't getting cleaned up between tests. Because you're using an ID #some-element
to bind to the click handler, the second test is spying on the first element, but you're clicking on the new one.
You can either:
- Spy on exactly the element you're concerned with:
spyOnEvent(element, 'click')
or - Clean up the DOM between tests (by
.remove()
ing the button, or clearing the body's HTML)