Search code examples
sveltetesting-librarysvelte-testing-library

Difference between fireEvent.dblClick & fireEvent.doubleClick in testing library?


Question about 2 different methods exposed via fireEvent API in the react-testing-library.

  • fireEvent.dblClick
  • fireEvent.doubleClick

What's the difference? And is there a recommendation to use one over the other?


Solution

  • There's zero difference.

    The Web platform natively has only "dblclick" event. Given that "doubleClick" is such a commonly mistaken event name, testing-library just makes it an alias of "dblClick".

    Source