mirror of
https://github.com/denoland/deno.git
synced 2024-10-31 09:14:20 -04:00
22 lines
670 B
TypeScript
22 lines
670 B
TypeScript
|
// 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);
|
||
|
});
|