import { expect, test } from "bun:test";
import { generate, parse } from "../src/index.ts";

test("client-rendered pages emit an inert template and browser mount anchor", () => {
  const code = generate(
    parse('page ClientOnly { render = "client" view { <main><h1>Browser only</h1></main> } }'),
  );
  expect(code).toContain('data-wrn-client-root="');
  expect(code).toContain('data-wrn-client-template="');
  expect(code.indexOf("Browser only")).toBeGreaterThan(code.indexOf("<template"));
});
