To add the text from an element to the clipboard
you need to:
1. get the current Selection
1. create a Range from the contents of the element
2. clear any existing Ranges from the Selection
and add the new Range to the selection
3. execute the 'copy' command
To track calls to all the DOM APIs involved in
this we need mocks for Range and Selection.
Range:
https://developer.mozilla.org/en-US/docs/Web/API/Range
Selection:
https://developer.mozilla.org/en-US/docs/Web/API/Selection
Also includes a base class to help building out
Web API interface mocks.
Extends triggerEvent, allowing the creation of
different types of event, and to change the data
on its object. Also fakes the positional data
browsers add to the event object.
Also adds helpers for simulating:
- all the events for a mouse click
- the events invovled in moving the selection in a radio group