import { render, Host } from "@cerxes/csx";
import { testContainer } from "../utils/test-container";

describe("Ref-property tests", () => {
    test("Simple ref", async () => {
        let targetVar = null;
        let refHandler = (el)=>targetVar = el;
        let container = testContainer(render(<div id="test-div" ref={refHandler}/>));
        
        expect(container.innerHTML).toBe(
            `<div id="test-div"></div>`
        );
        
        expect(targetVar).not.toBe(null);
        expect(targetVar.id).toBe('test-div')
    });
});