Commit Graph

7 Commits

Author SHA1 Message Date
Tom Byers
0e7b529fbc Add mock helpers for Range and Selection
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.
2019-08-20 13:49:09 +01:00
Tom Byers
6854361375 Expand event helpers
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
2019-08-07 10:23:09 +01:00
Tom Byers
1a5d40312a Move window mock functions into helper class 2019-06-12 16:03:35 +01:00
Tom Byers
0131f0c1b1 Move setup/teardown out of tests 2019-06-12 16:03:18 +01:00
Tom Byers
ccd09b9fd7 Revert "Merge pull request #2969 from alphagov/revert-2956-progressively-enhance-folder-permissions"
This reverts commit 8266f3d65c, reversing
changes made to b2a38fe222.
2019-05-15 14:26:51 +01:00
Tom Byers
0e6caa7fda Revert "Progressively enhance folder permissions" 2019-05-13 16:19:24 +01:00
Tom Byers
90ad8b4ed0 Add helpers for JS tests
To help with asserting some things which were
repeated in the tests.
2019-05-08 17:08:20 +01:00