diff --git a/test/parser/samples/error-svelte-selfdestructive/error.json b/test/parser/samples/error-svelte-selfdestructive/error.json index 68aa43dec9..f7cca12740 100644 --- a/test/parser/samples/error-svelte-selfdestructive/error.json +++ b/test/parser/samples/error-svelte-selfdestructive/error.json @@ -1,6 +1,6 @@ { "code": "invalid-tag-name", - "message": "Valid tag names are svelte:head, svelte:options, svelte:window, svelte:body, svelte:self, svelte:component, svelte:fragment or svelte:element", + "message": "Valid tag names are svelte:head, svelte:options, svelte:window, svelte:document, svelte:body, svelte:self, svelte:component, svelte:fragment or svelte:element", "pos": 10, "start": { "character": 10, diff --git a/test/runtime/samples/action-document/_config.js b/test/runtime/samples/action-document/_config.js new file mode 100644 index 0000000000..d33cdb3fa4 --- /dev/null +++ b/test/runtime/samples/action-document/_config.js @@ -0,0 +1,14 @@ +export default { + html: '
', + + async test({ assert, target, window }) { + const visibility = new window.Event('visibilitychange'); + + await window.document.dispatchEvent(visibility); + assert.htmlEqual(target.innerHTML, ` +
+
Perform an Action
+
+ `); + } +}; diff --git a/test/runtime/samples/action-document/main.svelte b/test/runtime/samples/action-document/main.svelte new file mode 100644 index 0000000000..eec4b3fecd --- /dev/null +++ b/test/runtime/samples/action-document/main.svelte @@ -0,0 +1,24 @@ + + + +