import assert from 'node:assert/strict' import test from 'node:test' import { validateIconSource } from './validateIcons.mjs' test('accepts a canonical stroke icon', () => { const source = ` ` assert.deepEqual(validateIconSource(source), []) }) test('accepts a fill-only icon', () => { const source = ` ` assert.deepEqual(validateIconSource(source), []) }) test('rejects a non-canonical stroke width', () => { const source = ` ` assert.deepEqual(validateIconSource(source, 'thin.svg'), [ 'thin.svg: stroke icons must use stroke-width="1.5" on the root ', ]) }) test('rejects child-level stroke styling', () => { const source = ` ` assert.deepEqual(validateIconSource(source, 'fixed.svg'), [ 'fixed.svg: move shared stroke, stroke-width attributes to the root ', ]) }) test('rejects inline styles on the root icon', () => { const source = ` ` assert.deepEqual(validateIconSource(source, 'root-style.svg'), [ 'root-style.svg: inline style attributes are not allowed on the root ', ]) }) test('rejects inline styles on child elements', () => { const source = ` ` assert.deepEqual(validateIconSource(source, 'child-style.svg'), [ 'child-style.svg: inline style attributes are not allowed on child elements', ]) }) test('rejects the legacy zero-width fill-only convention', () => { const source = ` ` assert.deepEqual(validateIconSource(source, 'logo.svg'), [ 'logo.svg: stroke icons must use fill="none" on the root ', 'logo.svg: stroke icons must use stroke-width="1.5" on the root ', ]) })