fix(web-test): strip dashes in fuzzy match for fillTableRow cell names

CamelCase cell IDs like "ИсходящиеБизнесПроцессПриемник" have no
dashes, but user keys like "Бизнес-процесс приемник" do. The previous
regex only stripped spaces, leaving the dash and causing match failure.
Now strip both spaces and dashes with /[\s\-]+/g in both the Tab-loop
path and the row/dblclick column-lookup path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-03-14 13:50:03 +03:00
parent 07be2bcafd
commit 21de2a4749
+3 -3
View File
@@ -2342,7 +2342,7 @@ export async function fillTableRow(fields, { tab, add, row, table } = {}) {
cols.push({ idx: i, text: ((t || box).innerText?.trim() || '').toLowerCase() });
});
const kl = ${JSON.stringify(key.toLowerCase())};
const klNoSpace = kl.replace(/\\s+/g, '');
const klNoSpace = kl.replace(/[\\s\\-]+/g, '');
let colIdx = -1;
const exact = cols.find(c => c.text === kl);
if (exact) colIdx = exact.idx;
@@ -2515,8 +2515,8 @@ export async function fillTableRow(fields, { tab, add, row, table } = {}) {
matchedKey = key;
break;
}
// CamelCase cell names have no spaces — try matching without spaces
const klNoSpace = kl.replace(/\s+/g, '');
// CamelCase cell names have no spaces/dashes — try matching without spaces and dashes
const klNoSpace = kl.replace(/[\s\-]+/g, '');
if (klNoSpace && (cellLower.endsWith(klNoSpace) || cellLower.includes(klNoSpace))) {
matchedKey = key;
break;