Skip to content

Commit db40a5c

Browse files
committed
Fix jest test issue for text selection
1 parent e506962 commit db40a5c

File tree

1 file changed

+23
-22
lines changed

1 file changed

+23
-22
lines changed

tests/jest/util/TextSelectionManager.test.js

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -138,30 +138,30 @@ const FAKE_DIALOGUE = `
138138
</PARAGRAPH>
139139
</OBJECT>
140140
`;
141+
document.body.innerHTML = '<div id="BookReader">';
142+
const br = window.br = new BookReader({
143+
data: [
144+
[
145+
{ width: 800, height: 1200,
146+
uri: '//archive.org/download/BookReader/img/page001.jpg' },
147+
],
148+
[
149+
{ width: 800, height: 1200,
150+
uri: '//archive.org/download/BookReader/img/page002.jpg' },
151+
{ width: 800, height: 1200,
152+
uri: '//archive.org/download/BookReader/img/page003.jpg' },
153+
],
154+
[
155+
{ width: 800, height: 1200,
156+
uri: '//archive.org/download/BookReader/img/page004.jpg' },
157+
{ width: 800, height: 1200,
158+
uri: '//archive.org/download/BookReader/img/page005.jpg' },
159+
],
160+
],
161+
});
162+
br.init();
141163

142164
describe("Generic tests", () => {
143-
document.body.innerHTML = '<div id="BookReader">';
144-
const br = window.br = new BookReader({
145-
data: [
146-
[
147-
{ width: 800, height: 1200,
148-
uri: '//archive.org/download/BookReader/img/page001.jpg' },
149-
],
150-
[
151-
{ width: 800, height: 1200,
152-
uri: '//archive.org/download/BookReader/img/page002.jpg' },
153-
{ width: 800, height: 1200,
154-
uri: '//archive.org/download/BookReader/img/page003.jpg' },
155-
],
156-
[
157-
{ width: 800, height: 1200,
158-
uri: '//archive.org/download/BookReader/img/page004.jpg' },
159-
{ width: 800, height: 1200,
160-
uri: '//archive.org/download/BookReader/img/page005.jpg' },
161-
],
162-
],
163-
});
164-
br.init();
165165

166166
afterEach(() => {
167167
sinon.restore();
@@ -235,6 +235,7 @@ describe("Generic tests", () => {
235235

236236

237237
describe("TextFragment tests", () => {
238+
238239
afterEach(() => {
239240
sinon.restore();
240241
$('.BRtextLayer').remove();

0 commit comments

Comments
 (0)