mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-21 19:25:35 -05:00
next integration tests (#1712)
* move integration tests pyscriptjs/tests/integration ->pyscript.core/tests/integration * add information in regards to how to run integration tests to README * fix fake server build paths * fix paths to build and run tests. The change of path before integration tests is a glitch maybe due to pytest cache? * remove test files created by mistake * update readme with latest changes --------- Co-authored-by: Fabio Pliger <fpliger@anaconda.com>
This commit is contained in:
33
pyscript.core/tests/integration/test_shadow_root.py
Normal file
33
pyscript.core/tests/integration/test_shadow_root.py
Normal file
@@ -0,0 +1,33 @@
|
||||
import pytest
|
||||
|
||||
from .support import PyScriptTest
|
||||
|
||||
|
||||
class TestShadowRoot(PyScriptTest):
|
||||
# @skip_worker("FIXME: js.document")
|
||||
@pytest.mark.skip("FIXME: Element interface is gone. Replace with PyDom")
|
||||
def test_reachable_shadow_root(self):
|
||||
self.pyscript_run(
|
||||
r"""
|
||||
<script>
|
||||
// reason to wait for py-script is that it's the entry point for
|
||||
// all patches and the MutationObserver, otherwise being this a synchronous
|
||||
// script the constructor gets instantly invoked at the node before
|
||||
// py-script gets a chance to initialize itself.
|
||||
customElements.whenDefined('py-script').then(() => {
|
||||
customElements.define('s-r', class extends HTMLElement {
|
||||
constructor() {
|
||||
super().attachShadow({mode: 'closed'}).innerHTML =
|
||||
'<div id="shadowed">OK</div>';
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<s-r></s-r>
|
||||
<py-script>
|
||||
import js
|
||||
js.console.log(Element("shadowed").innerHtml)
|
||||
</py-script>
|
||||
"""
|
||||
)
|
||||
assert self.console.log.lines[-1] == "OK"
|
||||
Reference in New Issue
Block a user