import assert from 'node:assert/strict'; import { readdirSync, readFileSync, statSync } from 'node:fs'; import { resolve } from 'node:path'; import test from 'node:test'; function collectTsx(directory: string): string[] { return readdirSync(directory).flatMap((name) => { const path = resolve(directory, name); return statSync(path).isDirectory() ? collectTsx(path) : name.endsWith('.tsx') ? [path] : []; }); } test('F6.17 uses one sortable table component for every active WEB table', () => { const webRoot = resolve(process.cwd(), '..', 'web-v2', 'src'); const files = collectTsx(webRoot); const rawTables = files.filter((path) => !path.endsWith('components/SortableTable.tsx') && readFileSync(path, 'utf8').includes(' readFileSync(path, 'utf8').includes(' count + (readFileSync(path, 'utf8').match(/ { const source = readFileSync(resolve(process.cwd(), '..', 'web-v2', 'src', 'components', 'SortableTable.tsx'), 'utf8'); assert.match(source, /aria-sort/); assert.match(source, /ascending/); assert.match(source, /descending/); assert.match(source, /dateValue/); assert.match(source, /numericPattern/); assert.match(source, /localeCompare\(right, 'es-AR'/); assert.match(source, /data-sortable/); });