hunk.code_window: 			"requires": {
   				"ms": "^2.0.0"
   			}
   		},
   		"hyper-dom-expressions": {
   			"version": "0.23.3",
   			"resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.23.3.tgz",
   			"integrity": "sha512-sgNN+TzN4XwrCKjKdv+LupFMC5q2ciA/h33HJKdb9RjLJ+gMSrWLa5hl0DWFkDb5d52eSHaAMTyL/tH69DRXuQ==",
   			"dev": true
   		},
   		"iconv-lite": {
   			"version": "0.4.24",
  
hunk.labels: keep keep keep keep keep replace replace replace keep keep keep keep
hunk.after_edit: 			"version": "0.23.4",
   			"resolved": "https://registry.npmjs.org/hyper-dom-expressions/-/hyper-dom-expressions-0.23.4.tgz",
   			"integrity": "sha512-bnEkXgsf7XtLON63gSBKYWZFGBAfIP+HMyfw+WzzX9LIcWucTaS/nPHVhi3Cw+u/ia2lddOO10QrcbJIr/M0eg==",
  
hunk.file_path: package-lock.json
hunk.type: replace
file: import { render, clearDelegatedEvents, Portal } from "../src";
  
  describe("Testing a simple Portal", () => {
    let div = document.createElement("div"),
      disposer: () => void;
    const testMount = document.createElement("div");
    const Component = () => <Portal mount={testMount}>Hi</Portal>;
  
    test("Create portal control flow", () => {
      disposer = render(Component, div);
      expect(div.innerHTML).toBe("");
      expect((testMount.firstChild as HTMLDivElement).innerHTML).toBe("Hi");
      expect((testMount.firstChild as HTMLDivElement & { host: HTMLElement }).host).toBe(div);
    });
  
    test("dispose", () => disposer());
  });
  
  describe("Testing an SVG Portal", () => {
    let div = document.createElement("div"),
      disposer: () => void;
    const testMount = document.createElement("svg");
    const Component = () => <Portal mount={testMount} isSVG={true}>Hi</Portal>;
  
    test("Create portal control flow", () => {
      disposer = render(Component, div);
      expect(div.innerHTML).toBe("");
      expect((testMount.firstChild as SVGGElement).innerHTML).toBe("Hi");
      expect((testMount.firstChild as SVGGElement & { host: SVGElement }).host).toBe(div);
    });
  
    test("dispose", () => disposer());
  });
  
  describe("Testing a Portal to the head", () => {
    let div = document.createElement("div"),
      disposer: () => void;
    const Component = () => (
      <Portal mount={document.head}>
        <title>A Meaningful Page Title</title>
      </Portal>
    );
  
    test("Create portal control flow", () => {
      disposer = render(Component, div);
      expect(div.innerHTML).toBe("");
      expect(document.head.innerHTML).toBe("<title>A Meaningful Page Title</title>");
    });
  
    test("dispose", () => disposer());
  });
  
  describe("Testing a Portal with Synthetic Events", () => {
    let div = document.createElement("div"),
      disposer: () => void,
      checkElem: HTMLDivElement,
      testElem: HTMLDivElement,
      clicked = false;
    const Component = () => (
      <Portal ref={checkElem}>
        <div ref={testElem} onClick={e => (clicked = true)} />
      </Portal>
    );
  
    test("Create portal control flow", () => {
      disposer = render(Component, div);
      expect(div.innerHTML).toBe("");
      expect(testElem).toBe(checkElem.firstChild);
    });
  
    test("Test portal element clicked", () => {
      expect(clicked).toBe(false);
      testElem.click();
      expect(clicked).toBe(true);
      clicked = false;
      clearDelegatedEvents();
      expect(clicked).toBe(false);
      testElem.click();
      expect(clicked).toBe(false);
    });
  
    test("dispose", () => disposer());
  });
  