wip: do not call document during JS unittests

This commit is contained in:
Yohan Boniface 2025-03-26 11:27:49 +01:00
parent d61e045903
commit 50f2c08ecb

View file

@ -11,6 +11,8 @@ export class UndoManager {
}
toggleState() {
// document is undefined during unittests
if (typeof document === 'undefined') return
const undoButton = document.querySelector('.edit-undo')
const redoButton = document.querySelector('.edit-redo')
if (undoButton) undoButton.disabled = !this._undoStack.length