Question · JavaScript and TypeScript course · Module 8: Events and the DOM

Simulating Clicks in Tests

How do you simulate a click on a DOM element in integration tests?

Answer options

  • element.simulateClick()
  • element.click()
  • jest.clickOn(element)
  • element.emit('click')

You can check the correct answer by solving this task in the CodeWorlds game.