1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-29 16:30:56 -05:00
denoland-deno/js/custom_event_test.ts

22 lines
670 B
TypeScript
Raw Normal View History

2019-01-23 07:20:53 -05:00
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
import { test, assertEqual } from "./test_util.ts";
test(function customEventInitializedWithDetail() {
const type = "touchstart";
const detail = { message: "hello" };
const customEventDict = new CustomEventInit({
bubbles: true,
cancelable: true,
detail
});
const event = new CustomEvent(type, customEventDict);
assertEqual(event.bubbles, true);
assertEqual(event.cancelable, true);
assertEqual(event.currentTarget, null);
assertEqual(event.detail, detail);
assertEqual(event.isTrusted, false);
assertEqual(event.target, null);
assertEqual(event.type, type);
});