'use strict'; const assert = require('node:assert/strict'); const fs = require('node:fs'); const path = require('node:path'); const test = require('node:test'); const root = path.resolve(__dirname, '..', '..'); const read = (file) => fs.readFileSync(path.join(root, file), 'utf8'); test('icon card renderers keep vertical and horizontal Zibll DOM contracts separate', () => { const helper = read('inc/helpers/aksrt-icon-cards.php'); const widgets = read('src/WidgetSystem/Renderers/GeneralRenderer.php'); const header = read('inc/helpers/homepage/header-components.php'); assert.match(helper, /
\$card\['customize_icon'\] \?\? ''/); assert.match(widgets, /'custom_icon'\s+=> \$card\['custom_icon'\] \?\? ''/); assert.match(widgets, /'icon_image'\s+=> \$card\['icon_image'\] \?\? ''/); assert.match(header, /empty\(\$card\['custom_icon'\]\)/); }); test('homepage horizontal cards render fully from Zibll CSS with no dedicated stylesheet', () => { const baseCss = read('assets/css/frontend/base.css'); const widgetCss = read('assets/widgets/frontend.css'); const scripts = read('src/Core/ScriptsPart1b.php'); assert.equal(fs.existsSync(path.join(root, 'assets/css/frontend/header-cards.css')), false); assert.doesNotMatch(baseCss, /\.icon-cover-card\.aksrt-icon-cover-card/); assert.doesNotMatch(baseCss, /\.header-components-card/); assert.doesNotMatch(scripts, /header-cards/); assert.doesNotMatch(widgetCss, /aksrt-widget-icon-cards \.icon-cover-card/); });