fix(web-test): fillTableRow fuzzy match for CamelCase cell names

Cell IDs in 1C tables are CamelCase without spaces (e.g.
"ВариантыАрхитектурыВариантАрхитектуры"), but users pass keys with
spaces ("Вариант архитектуры"). Added space-stripped fallback to
fuzzy match so fillTableRow correctly maps user keys to grid cells.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-03-12 15:44:43 +03:00
parent 85191dc759
commit 23f4cc0bbd
+7 -1
View File
@@ -2055,7 +2055,7 @@ export async function fillTableRow(fields, { tab, add, row } = {}) {
}
prevCellId = cell.id;
// Fuzzy match cell name to user field: exact → suffix → includes
// Fuzzy match cell name to user field: exact → suffix → includes → no-space includes
const cellLower = cell.fullName.toLowerCase();
let matchedKey = null;
for (const [key, info] of pending) {
@@ -2065,6 +2065,12 @@ export async function fillTableRow(fields, { tab, add, row } = {}) {
matchedKey = key;
break;
}
// CamelCase cell names have no spaces — try matching without spaces
const klNoSpace = kl.replace(/\s+/g, '');
if (klNoSpace && (cellLower.endsWith(klNoSpace) || cellLower.includes(klNoSpace))) {
matchedKey = key;
break;
}
}
if (!matchedKey) {