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, }, ); });