mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-06 03:13:42 -05:00
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.