Закрепляет первую колонку данных FORM_2/AHR (rf), тянет её границу 50×(+4 px) и 50×(−4 px) с ожиданием кадра, после отпускания проверяет примыкание td[data-pinned]. Для сборки базы (без data-col-resize-id) — запасной поиск ресайзера. Замеры не запускались. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
25 lines
1.1 KiB
TypeScript
25 lines
1.1 KiB
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import { findPinnedGap } from '../lib/pinnedGeometry.ts';
|
|
|
|
test('примыкающие закреплённые колонки: -1', () => {
|
|
assert.equal(findPinnedGap([{ left: 0, width: 40 }, { left: 40, width: 120 }, { left: 160, width: 300 }]), -1);
|
|
});
|
|
|
|
test('наложение после смены ширины: индекс левой колонки пары', () => {
|
|
assert.equal(findPinnedGap([{ left: 0, width: 40 }, { left: 40, width: 200 }, { left: 160, width: 300 }]), 1);
|
|
});
|
|
|
|
test('зазор: индекс левой колонки пары', () => {
|
|
assert.equal(findPinnedGap([{ left: 0, width: 40 }, { left: 60, width: 120 }]), 0);
|
|
});
|
|
|
|
test('дробные пиксели в пределах допуска 1 px: -1', () => {
|
|
assert.equal(findPinnedGap([{ left: 0, width: 40.4 }, { left: 41.2, width: 10 }]), -1);
|
|
});
|
|
|
|
test('меньше двух колонок: -1', () => {
|
|
assert.equal(findPinnedGap([]), -1);
|
|
assert.equal(findPinnedGap([{ left: 0, width: 40 }]), -1);
|
|
});
|