// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`event handling can set handler on sub component 1`] = `
"function anonymous(bdom, helpers
) {
  let { text, createBlock, list, multi, html, toggler, component } = bdom;
  let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers;
  
  let block1 = createBlock(\`<div>simple vnode</div>\`);
  
  return function template(ctx, node, key = \\"\\") {
    return block1();
  }
}"
`;

exports[`event handling can set handler on sub component 2`] = `
"function anonymous(bdom, helpers
) {
  let { text, createBlock, list, multi, html, toggler, component } = bdom;
  let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers;
  let assign = Object.assign;
  
  return function template(ctx, node, key = \\"\\") {
    let h2 = [\`click\`, ctx, 'inc'];
    let b2 = assign(component(\`Child\`, {}, key + \`__1\`, node, ctx), {handlers: [h2]});
    let b3 = text(ctx['state'].value);
    return multi([b2, b3]);
  }
}"
`;

exports[`event handling handler receive the event as argument 1`] = `
"function anonymous(bdom, helpers
) {
  let { text, createBlock, list, multi, html, toggler, component } = bdom;
  let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers;
  
  let block1 = createBlock(\`<div>simple vnode</div>\`);
  
  return function template(ctx, node, key = \\"\\") {
    return block1();
  }
}"
`;

exports[`event handling handler receive the event as argument 2`] = `
"function anonymous(bdom, helpers
) {
  let { text, createBlock, list, multi, html, toggler, component } = bdom;
  let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers;
  let assign = Object.assign;
  
  return function template(ctx, node, key = \\"\\") {
    let h2 = [\`click\`, ctx, 'inc'];
    let b2 = assign(component(\`Child\`, {}, key + \`__1\`, node, ctx), {handlers: [h2]});
    let b3 = text(ctx['state'].value);
    return multi([b2, b3]);
  }
}"
`;

exports[`event handling support for callable expression in event handler 1`] = `
"function anonymous(bdom, helpers
) {
  let { text, createBlock, list, multi, html, toggler, component } = bdom;
  let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers;
  
  let block1 = createBlock(\`<div><block-text-0/><input type=\\"text\\" block-handler-1=\\"input\\"/></div>\`);
  
  return function template(ctx, node, key = \\"\\") {
    let d1 = ctx['state'].value;
    const v1 = ctx['obj'];
    let d2 = (e) => {const res = (() => { return v1.onInput })(); if (typeof res === 'function') { res(e) }};
    return block1([d1, d2]);
  }
}"
`;

exports[`event handling t-on with handler bound to dynamic argument on a t-foreach 1`] = `
"function anonymous(bdom, helpers
) {
  let { text, createBlock, list, multi, html, toggler, component } = bdom;
  let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue } = helpers;
  
  let block1 = createBlock(\`<div><block-child-0/></div>\`);
  let block3 = createBlock(\`<div class=\\"item\\" block-handler-0=\\"click\\"/>\`);
  
  return function template(ctx, node, key = \\"\\") {
    ctx = Object.create(ctx);
    const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['items']);
    for (let i1 = 0; i1 < l_block2; i1++) {
      ctx[\`item\`] = v_block2[i1];
      let key1 = ctx['item'];
      const arg1 = [ctx['item']];
      let d1 = [ctx, 'onClick', arg1];
      c_block2[i1] = withKey(block3([d1]), key1);
    }
    let b2 = list(c_block2);
    return block1([], [b2]);
  }
}"
`;
