import { isStaticMarkup, STANDARD_HTML_TAGS } from '../src/engine/AreHTML.constants';
/**
* Unit coverage for the static-island detector that drives the
* tokenizer fast-path (skip per-node explosion) and the AddStaticHTML
* one-shot materialisation. Correctness here is what guarantees we never
* collapse a subtree that actually needs reactive per-node handling.
*/
describe('isStaticMarkup — static-island detection', () => {
describe('returns TRUE for fully static content', () => {
it('plain text', () => {
expect(isStaticMarkup('Hello World')).toBe(true);
});
it('text with HTML entities (the case)', () => {
expect(isStaticMarkup('Hello World')).toBe(true);
expect(isStaticMarkup('a & b c A')).toBe(true);
});
it('a single standard element with static attributes', () => {
expect(isStaticMarkup('hi')).toBe(true);
});
it('nested standard elements', () => {
expect(isStaticMarkup('
Hello World
')).toBe(true);
});
it('static attribute value containing a colon (url / style)', () => {
expect(isStaticMarkup('x')).toBe(true);
expect(isStaticMarkup('x')).toBe(true);
});
it('static attribute value containing @ (email)', () => {
expect(isStaticMarkup('x')).toBe(true);
});
it('void elements and self-closing tags', () => {
expect(isStaticMarkup('line break')).toBe(true);
expect(isStaticMarkup('')).toBe(true);
});
it('table fragments', () => {
expect(isStaticMarkup('