summaryrefslogtreecommitdiff
path: root/js/event_test.ts
diff options
context:
space:
mode:
author迷渡 <justjavac@gmail.com>2019-06-20 20:21:43 +0800
committerRyan Dahl <ry@tinyclouds.org>2019-06-20 05:21:43 -0700
commit6a5177dc11936687e6da95c3c45e3e41a7856d79 (patch)
tree5efc16db9dd461a0d551fb0ad27bae5de18a1177 /js/event_test.ts
parent425df50484f315dcd63b4d93ab6911702779899e (diff)
event `isTrusted` is enumerable (#2543)
Diffstat (limited to 'js/event_test.ts')
-rw-r--r--js/event_test.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/js/event_test.ts b/js/event_test.ts
index 75ff8bed1..b31ffdecf 100644
--- a/js/event_test.ts
+++ b/js/event_test.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
-import { test, assertEquals } from "./test_util.ts";
+import { test, assertEquals, assertNotEquals } from "./test_util.ts";
test(function eventInitializedWithType(): void {
const type = "click";
@@ -80,3 +80,16 @@ test(function eventInitializedWithNonStringType(): void {
assertEquals(event.bubbles, false);
assertEquals(event.cancelable, false);
});
+
+// ref https://github.com/web-platform-tests/wpt/blob/master/dom/events/Event-isTrusted.any.js
+test(function eventIsTrusted(): void {
+ const desc1 = Object.getOwnPropertyDescriptor(new Event("x"), "isTrusted");
+ assertNotEquals(desc1, undefined);
+ assertEquals(typeof desc1.get, "function");
+
+ const desc2 = Object.getOwnPropertyDescriptor(new Event("x"), "isTrusted");
+ assertNotEquals(desc2, undefined);
+ assertEquals(typeof desc2.get, "function");
+
+ assertEquals(desc1.get, desc2.get);
+});