Skip to content

Commit 7517937

Browse files
committed
add createEvent tests
1 parent a86fa8c commit 7517937

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/tests/dom/document.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,3 +167,23 @@
167167
acss.push(new CSSStyleSheet());
168168
testing.expectEqual(1, acss.length);
169169
</script>
170+
171+
<script id=createEvent>
172+
const event = document.createEvent("Event");
173+
174+
testing.expectEqual(true, event instanceof Event);
175+
testing.expectEqual("", event.type);
176+
177+
const customEvent = document.createEvent("CustomEvent");
178+
customEvent.initCustomEvent("hey", false, false);
179+
180+
testing.expectEqual(true, customEvent instanceof CustomEvent);
181+
testing.expectEqual(true, customEvent instanceof Event);
182+
183+
testing.withError(
184+
(err) => {
185+
// TODO: Check the error type.
186+
},
187+
() => document.createEvent("InvalidType"),
188+
);
189+
</script>

0 commit comments

Comments
 (0)