The test cypress/integration/spec.js shows how the Cypress test can listen to the custom DOM events sent to the document
object. Watch the video Listen To The Application Dispatching Events To The Document.
The spec also shows how the Cypress test can confirm a custom event sent to the ref.current
element by the React code. Watch the video Testing DOM Events Sent to ref.current Element By React App and read the blog post Listen To The Application Events From Cypress Tests