Files
dbx/packages/app-tests/dataGridScrollGutter.test.ts
T
t8y2 fabf2172e4 chore: migrate test runner from node:test/tsx to vitest
155 files, 1091 tests, 4.3s (2x faster than previous 9.1s).
2026-06-08 01:17:27 +08:00

14 lines
696 B
TypeScript

import { strict as assert } from "node:assert";
import { test } from "vitest";
import { dataGridHeaderContentWidth, scrollbarGutterWidth } from "../../apps/desktop/src/lib/dataGridScrollGutter.ts";
test("calculates scrollbar gutter from element dimensions", () => {
assert.equal(scrollbarGutterWidth({ offsetWidth: 1000, clientWidth: 985 }), 15);
assert.equal(scrollbarGutterWidth({ offsetWidth: 1000, clientWidth: 1000 }), 0);
});
test("extends header content width by the body scrollbar gutter", () => {
assert.equal(dataGridHeaderContentWidth("var(--total-w)", 15), "calc(var(--total-w) + 15px)");
assert.equal(dataGridHeaderContentWidth("var(--total-w)", 0), "var(--total-w)");
});