2019-01-23 07:20:53 -05:00
|
|
|
// Copyright 2018 the Deno authors. All rights reserved. MIT license.
|
2019-03-06 20:48:46 -05:00
|
|
|
import { test, assertEquals } from "./test_util.ts";
|
2019-01-23 07:20:53 -05:00
|
|
|
|
|
|
|
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);
|
|
|
|
|
2019-03-06 20:48:46 -05:00
|
|
|
assertEquals(event.bubbles, true);
|
|
|
|
assertEquals(event.cancelable, true);
|
|
|
|
assertEquals(event.currentTarget, null);
|
|
|
|
assertEquals(event.detail, detail);
|
|
|
|
assertEquals(event.isTrusted, false);
|
|
|
|
assertEquals(event.target, null);
|
|
|
|
assertEquals(event.type, type);
|
2019-01-23 07:20:53 -05:00
|
|
|
});
|