dom-testing-library
Advanced tools
Comparing version 3.17.0 to 3.17.1
@@ -145,2 +145,13 @@ "use strict"; | ||
window.removeEventListener('message', messageSpy); | ||
}); | ||
test('fires events on Document', () => { | ||
const keyDownSpy = jest.fn(); | ||
document.addEventListener('keydown', keyDownSpy); | ||
_.fireEvent.keyDown(document, { | ||
key: 'Escape' | ||
}); | ||
expect(keyDownSpy).toHaveBeenCalledTimes(1); | ||
document.removeEventListener('keydown', keyDownSpy); | ||
}); |
@@ -1559,5 +1559,6 @@ 'use strict'; | ||
}); | ||
} | ||
} // if the node does not have an owner document, then it probably _is_ the owner document | ||
var window = node.ownerDocument.defaultView; | ||
var window = (node.ownerDocument || node).defaultView; | ||
var EventConstructor = window[EventType] || window.Event; | ||
@@ -1564,0 +1565,0 @@ var event = new EventConstructor(eventName, eventInit); |
@@ -1553,5 +1553,6 @@ import _extends from '@babel/runtime/helpers/esm/extends'; | ||
}); | ||
} | ||
} // if the node does not have an owner document, then it probably _is_ the owner document | ||
var window = node.ownerDocument.defaultView; | ||
var window = (node.ownerDocument || node).defaultView; | ||
var EventConstructor = window[EventType] || window.Event; | ||
@@ -1558,0 +1559,0 @@ var event = new EventConstructor(eventName, eventInit); |
@@ -568,5 +568,6 @@ "use strict"; | ||
}); | ||
} | ||
} // if the node does not have an owner document, then it probably _is_ the owner document | ||
const window = node.ownerDocument.defaultView; | ||
const window = (node.ownerDocument || node).defaultView; | ||
const EventConstructor = window[EventType] || window.Event; | ||
@@ -573,0 +574,0 @@ const event = new EventConstructor(eventName, eventInit); |
{ | ||
"name": "dom-testing-library", | ||
"version": "3.17.0", | ||
"version": "3.17.1", | ||
"description": "Simple and complete DOM testing utilities that encourage good testing practices.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -141,3 +141,3 @@ <div align="center"> | ||
| [<img src="https://avatars0.githubusercontent.com/u/19773?v=4" width="100px;" alt="Royston Shufflebotham"/><br /><sub><b>Royston Shufflebotham</b></sub>](https://github.com/RoystonS)<br />[π](https://github.com/kentcdodds/dom-testing-library/issues?q=author%3ARoystonS "Bug reports") [π»](https://github.com/kentcdodds/dom-testing-library/commits?author=RoystonS "Code") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=RoystonS "Documentation") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=RoystonS "Tests") | [<img src="https://avatars0.githubusercontent.com/u/591673?v=4" width="100px;" alt="Vadim Brodsky"/><br /><sub><b>Vadim Brodsky</b></sub>](http://www.vadimbrodsky.com)<br />[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=VadimBrodsky "Code") | [<img src="https://avatars3.githubusercontent.com/u/499898?v=4" width="100px;" alt="Eunjae Lee"/><br /><sub><b>Eunjae Lee</b></sub>](https://twitter.com/eunjae_lee)<br />[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=eunjae-lee "Code") | [<img src="https://avatars2.githubusercontent.com/u/167743?v=4" width="100px;" alt="David Peter"/><br /><sub><b>David Peter</b></sub>](http://davidpeter.me)<br />[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=sarenji "Code") | [<img src="https://avatars0.githubusercontent.com/u/13174025?v=4" width="100px;" alt="Shy Alter"/><br /><sub><b>Shy Alter</b></sub>](https://twitter.com/@puemos)<br />[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=puemos "Code") [π](https://github.com/kentcdodds/dom-testing-library/commits?author=puemos "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/11966621?v=4" width="100px;" alt="Εukasz Makuch"/><br /><sub><b>Εukasz Makuch</b></sub>](https://lukaszmakuch.pl)<br />[π¦](#platform-lukaszmakuch "Packaging/porting to new platform") | [<img src="https://avatars1.githubusercontent.com/u/11150235?v=4" width="100px;" alt="Tyler Haas"/><br /><sub><b>Tyler Haas</b></sub>](https://github.com/tylerthehaas)<br />[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=tylerthehaas "Code") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=tylerthehaas "Tests") | | ||
| [<img src="https://avatars2.githubusercontent.com/u/482561?v=4" width="100px;" alt="Vesa Laakso"/><br /><sub><b>Vesa Laakso</b></sub>](http://vesalaakso.com)<br />[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=valscion "Code") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=valscion "Tests") | [<img src="https://avatars0.githubusercontent.com/u/16590492?v=4" width="100px;" alt="Tulsi Sapkota"/><br /><sub><b>Tulsi Sapkota</b></sub>](https://github.com/Tolsee)<br />[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=Tolsee "Code") | | ||
| [<img src="https://avatars2.githubusercontent.com/u/482561?v=4" width="100px;" alt="Vesa Laakso"/><br /><sub><b>Vesa Laakso</b></sub>](http://vesalaakso.com)<br />[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=valscion "Code") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=valscion "Tests") | [<img src="https://avatars0.githubusercontent.com/u/16590492?v=4" width="100px;" alt="Tulsi Sapkota"/><br /><sub><b>Tulsi Sapkota</b></sub>](https://github.com/Tolsee)<br />[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=Tolsee "Code") | [<img src="https://avatars1.githubusercontent.com/u/163187?v=4" width="100px;" alt="Tiago Nunes"/><br /><sub><b>Tiago Nunes</b></sub>](https://github.com/tnunes)<br />[π»](https://github.com/kentcdodds/dom-testing-library/commits?author=tnunes "Code") [β οΈ](https://github.com/kentcdodds/dom-testing-library/commits?author=tnunes "Tests") | | ||
@@ -144,0 +144,0 @@ <!-- ALL-CONTRIBUTORS-LIST:END --> |
250607
6411