Files
VSCode-Fluid-Font-Generator/test/webviewText.test.js
T
Keith Solomon fa3df3e3f4 feat: add Fluid Typography Generator extension for VSCode
- Implemented core functionality to generate fluid typography CSS variables based on user-defined breakpoints and font sizes.
- Created configuration options for output format (Tailwind or vanilla CSS) and rounding settings.
- Added input parsing for settings from text files or VSCode interface.
- Developed CSS generation logic with support for `clamp()` and optional rounding.
- Included tests for parsing settings, generating CSS, and inserting text at selection in the editor.
- Documented project details and usage in project.md.
- Added example CSS output in typography.css.
2026-06-06 22:21:22 -05:00

27 lines
731 B
JavaScript

const assert = require('node:assert/strict');
const test = require('node:test');
const { insertTextAtSelectionValue } = require('../src/webviewText');
test('insertTextAtSelectionValue inserts clipboard text at the caret', () => {
assert.deepEqual(
insertTextAtSelectionValue('text-14px: 12px-14px', 20, 20, '\ntext-16px: 14px-16px'),
{
value: 'text-14px: 12px-14px\ntext-16px: 14px-16px',
selectionStart: 41,
selectionEnd: 41,
},
);
});
test('insertTextAtSelectionValue replaces selected text', () => {
assert.deepEqual(
insertTextAtSelectionValue('before OLD after', 7, 10, 'NEW'),
{
value: 'before NEW after',
selectionStart: 10,
selectionEnd: 10,
},
);
});