stable

Clone or download

Read-only

request #15128 Inject document in TLP components

This allows tests to create a separate document and avoid polluting the global one. Current tests always clean up after themselves but having a separate document guarantees that if someone forgets to remove elements after a test, the global jsdom document won't have leftover elements. It also tracks component dependencies a little bit better. Also took the opportunity to deduplicate event and class names by exporting them. How to test: no functional change Change-Id: I00f0ea48c77e17a44d737eb7328951d72f7211d9

Modified Files

Name
M src/themes/tlp/src/index.d.ts +18 −5 Go to diff View file
M src/themes/tlp/src/js/dom-walker.js +2 −2 Go to diff View file
M src/themes/tlp/src/js/dropdowns.d.ts +7 −1 Go to diff View file
M src/themes/tlp/src/js/dropdowns.js +14 −14 Go to diff View file
M src/themes/tlp/src/js/dropdowns.test.ts +43 −33 Go to diff View file
M src/themes/tlp/src/js/index.js +6 −5 Go to diff View file
M src/themes/tlp/src/js/modal.d.ts +10 −2 Go to diff View file
M src/themes/tlp/src/js/modal.js +20 −21 Go to diff View file
M src/themes/tlp/src/js/modal.test.ts +49 −41 Go to diff View file
M src/themes/tlp/src/js/popovers.d.ts +3 −0 Go to diff View file
M src/themes/tlp/src/js/popovers.js +31 −28 Go to diff View file
M src/themes/tlp/src/js/popovers.test.ts +45 −41 Go to diff View file