diff options
Diffstat (limited to 'js/event_test.ts')
-rw-r--r-- | js/event_test.ts | 15 |
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); +}); |