/* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ import { Component, createElement, Fragment } from "../../dist"; import { renderPage } from "../../dist/render"; import { testSuite } from "../lib"; testSuite("renderPage", ({ test, expect }) => { test("throws an Error when root elem is not html tag", () => { expect(() => renderPage(
)).toThrowErrorMatching( "attempted to render page with non-HTML root element div" ); }); test("outputs a HTML5 DOCTYPE declaration", () => { const html = renderPage( ); expect(html).toEqual( "); expect(html).toStartWith(""); }); test("escapes HTML in tag names", () => { const html = renderPage( {createElement("div> ); expect(html).toEqual( "
" ); }); test("renders html attributes", () => { const html = renderPage(
); expect(html).toEqual( '
' ); }); test("renders common html tags", () => { const html = renderPage(