import { describe, expect, test } from "bun:test"
import { extractHtml } from "./html-text-map.mjs"
/** {T} is the target sentence: every row runs once with English text and once with Korean text. */
const TARGET = { en: "Target length is 999 m.", ko: "\ubaa9\ud45c \uae38\uc774\ub294 999 m\uc774\ub2e4." }
const CONTROL = "Control length is 410 m."
type Row = { form: string; html: string; expected: "hidden" | "visible" }
const css = (sheet: string, element = '
{T}
') => `${element}`
const ROWS: Row[] = [
// conditional and grouping at-rules: only an unconditional rule hides; a conditional one never does
{ form: "@media (max-width:600px)", html: css("@media (max-width:600px){.x{display:none}}"), expected: "visible" },
{ form: "@media print", html: css("@media print{.x{display:none}}"), expected: "visible" },
{ form: "@media screen and (min-width:0)", html: css("@media screen and (min-width: 0){.x{display:none}}"), expected: "visible" },
{ form: "@media not print", html: css("@media not print{.x{display:none}}"), expected: "visible" },
{ form: "@media all", html: css("@media all{.x{display:none}}"), expected: "hidden" },
{ form: "@media all and (min-width:1px)", html: css("@media all and (min-width:1px){.x{display:none}}"), expected: "visible" },
{ form: "@supports (display:grid)", html: css("@supports (display:grid){.x{display:none}}"), expected: "visible" },
{ form: "@container (min-width:400px)", html: css("@container (min-width: 400px){.x{display:none}}"), expected: "visible" },
{ form: "@scope (.card)", html: css("@scope (.card){.x{display:none}}", '