diff --git a/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/utils.test.js b/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/utils.test.js index d43e73464c7..6e22d6d2d74 100644 --- a/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/utils.test.js +++ b/addons/web_editor/static/src/js/editor/odoo-editor/test/spec/utils.test.js @@ -404,6 +404,11 @@ describe('Utils', () => { const result = closestBlock(p); window.chai.expect(result).to.equal(p); }); + it('should return null if no block ancestor', () => { + const node = document.createTextNode('\n '); + window.chai.expect(closestBlock(node)).to.equal(null); + window.chai.expect(isVisibleTextNode(node)).to.equal(false); + }); }); describe('lastLeaf', () => { it('should find the last leaf of a child-rich block', () => {