// @vitest-environment happy-dom
import { afterEach, describe, expect, it } from "vitest";
import { destroyHost, showStep } from "./render.js";

afterEach(() => {
	destroyHost();
});

describe("showStep", () => {
	it("insere le HTML de body deja assaini", () => {
		showStep(
			{ id: "st", type: "modal", title: "Titre", body: "<strong>ok</strong>" },
			null,
			{ onNext() {}, onDismiss() {}, onChoice() {} },
		);
		const body = document
			.querySelector("[data-circuy]")
			?.shadowRoot?.querySelector(".body");
		expect(body?.innerHTML).toContain("<strong>ok</strong>");
	});
});
