diff --git a/umap/static/umap/js/modules/sync/undo.js b/umap/static/umap/js/modules/sync/undo.js index e96bcf9d..47e0a3de 100644 --- a/umap/static/umap/js/modules/sync/undo.js +++ b/umap/static/umap/js/modules/sync/undo.js @@ -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