import {createWord} from './EmptyWord';
import {mergeRun} from '../src/util/mergeRun';
import {parseXML, buildXML} from '../src/util/xml';
test('proofErr', async () => {
const xmlDoc = parseXML(
`
{{var
}}
`.trim()
);
const word = await createWord();
mergeRun(word, xmlDoc);
expect(xmlDoc.getElementsByTagName('w:t')[0]?.innerHTML).toBe('{{var}}');
});
test('font hint', async () => {
const xmlDoc = parseXML(
`
B
6
`.trim()
);
const word = await createWord();
mergeRun(word, xmlDoc);
console.log(buildXML(xmlDoc));
expect(xmlDoc.getElementsByTagName('w:t')[0]?.innerHTML).toBe('B6');
});
test('space', async () => {
const xmlDoc = parseXML(
`
C
ustom
Style
`.trim()
);
const word = await createWord();
mergeRun(word, xmlDoc);
expect(xmlDoc.getElementsByTagName('w:t')[0]?.innerHTML).toBe('Custom');
});