0
Fork 0
mirror of https://github.com/fastmail/Squire.git synced 2024-12-22 15:23:29 -05:00

Type editor in spec

This makes it easier to catch inconsistencies between the spec and
interface for Squire.
This commit is contained in:
Callum Skeet 2023-07-31 11:31:18 +10:00
parent 54914dd5d5
commit 3dcd940a20

View file

@ -7,7 +7,7 @@ import { Squire } from '../source/Editor';
document.body.innerHTML = `<div id="squire">`; document.body.innerHTML = `<div id="squire">`;
let editor; let editor: Squire;
describe('Squire RTE', () => { describe('Squire RTE', () => {
beforeEach(() => { beforeEach(() => {
@ -25,7 +25,7 @@ describe('Squire RTE', () => {
}); });
}); });
function selectAll(editor) { function selectAll(editor: Squire) {
document.getSelection()!.removeAllRanges(); document.getSelection()!.removeAllRanges();
const range = document.createRange(); const range = document.createRange();
range.setStart(editor._root.childNodes.item(0), 0); range.setStart(editor._root.childNodes.item(0), 0);
@ -524,7 +524,7 @@ describe('Squire RTE', () => {
}); });
afterEach(() => { afterEach(() => {
editor = null; editor = null as any;
document.body.innerHTML = `<div id="squire">`; document.body.innerHTML = `<div id="squire">`;
}); });
}); });