Commit d05f3e29 authored by Alejandro Celaya's avatar Alejandro Celaya Committed by Alejandro Celaya

Test isTextLayerRenderingDone with an actual DOM node

parent 8eb1e83d
...@@ -741,18 +741,22 @@ describe('annotator/anchoring/pdf', () => { ...@@ -741,18 +741,22 @@ describe('annotator/anchoring/pdf', () => {
}); });
[ [
{ element: null, expectedResult: false }, { div: document.createElement('div'), expectedResult: false },
{ element: {}, expectedResult: true }, {
].forEach(({ element, expectedResult }) => { div: (function () {
it('returns true if the div contains an endOfContent element', () => { const div = document.createElement('div');
assert.equal(
isTextLayerRenderingDone({ const endOfContent = document.createElement('div');
div: { endOfContent.className = 'endOfContent';
querySelector: () => element, div.append(endOfContent);
return div;
})(),
expectedResult: true,
}, },
}), ].forEach(({ div, expectedResult }) => {
expectedResult, it('returns true if the div contains an endOfContent element', () => {
); assert.equal(isTextLayerRenderingDone({ div }), expectedResult);
}); });
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment