diff --git a/src/view/containerelement.js b/src/view/containerelement.js index 5169c10d5..761a45dd7 100644 --- a/src/view/containerelement.js +++ b/src/view/containerelement.js @@ -62,10 +62,12 @@ export default class ContainerElement extends Element { } } -// Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed. -// -// @returns {Number|null} Block filler offset or `null` if block filler is not needed. -function getFillerOffset() { +/** + * Returns block {@link module:engine/view/filler filler} offset or `null` if block filler is not needed. + * + * @returns {Number|null} Block filler offset or `null` if block filler is not needed. + */ +export function getFillerOffset() { const children = [ ...this.getChildren() ]; const lastChild = children[ this.childCount - 1 ]; diff --git a/tests/view/containerelement.js b/tests/view/containerelement.js index d3a29dc1d..ddc8552d5 100644 --- a/tests/view/containerelement.js +++ b/tests/view/containerelement.js @@ -3,7 +3,7 @@ * For licensing, see LICENSE.md. */ -import ContainerElement from '../../src/view/containerelement'; +import { default as ContainerElement, getFillerOffset } from '../../src/view/containerelement'; import Element from '../../src/view/element'; import { parse } from '../../src/dev-utils/view'; @@ -96,3 +96,9 @@ describe( 'ContainerElement', () => { } ); } ); } ); + +describe( 'getFillerOffset()', () => { + it( 'should be a function that can be used in other places', () => { + expect( getFillerOffset ).is.a( 'function' ); + } ); +} );