diff --git a/test.ts b/test.ts index dfde856..7940746 100644 --- a/test.ts +++ b/test.ts @@ -40,23 +40,18 @@ Deno.test("on.__mount__ is called after other initialization is finished", () => let hasSubBar = false; let hasInnerHTML = false; - on.__mount__ = ({ el, emit }) => { - emit("my-event"); + on.__mount__ = ({ el }) => { hasFoo = el.classList.contains("foo"); hasSubBar = el.classList.contains("sub:bar"); hasInnerHTML = el.innerHTML === "

hello

"; }; - on["my-event"] = () => { - myEventTriggered = true; - }; is("foo"); sub("bar"); innerHTML("

hello

"); mount(); - assert(myEventTriggered); assert(hasFoo); assert(hasSubBar); assert(hasInnerHTML); @@ -223,29 +218,7 @@ Deno.test("pub, sub works", () => { mount(); assert(subCalled); }); -Deno.test("emit works", () => { - document.body.innerHTML = - `
`; - const EVENT = "my-event"; - let parentCalled = false; - { - const { on } = component("parent"); - on[EVENT] = () => { - parentCalled = true; - }; - } - { - const { on } = component("child"); - // FIXME(kt3k): workaround for deno_dom & deno issue - // deno_dom doesn't bubble event when the direct target dom doesn't have event handler - on[EVENT] = () => {}; - on.__mount__ = ({ emit }) => { - emit(EVENT); - }; - } - mount(); - assert(parentCalled); -}); + Deno.test("query, queryAll works", () => { const name = randomName(); document.body.innerHTML = `