Skip to content

Commit 9976a72

Browse files
committed
TEST
1 parent 811a535 commit 9976a72

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

test/integration/reorganize_pages_spec.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,27 +209,36 @@ describe("Reorganize Pages View", () => {
209209
);
210210
});
211211

212-
it("should reorder thumbnails after dropping", async () => {
212+
fit("should reorder thumbnails after dropping", async () => {
213213
await Promise.all(
214214
pages.map(async ([browserName, page]) => {
215+
page.on('console', msg => console.log('PAGE LOG:', msg.text()));
216+
console.log('1');
215217
await waitForThumbnailVisible(page, 1);
218+
console.log('2');
216219
const rect1 = await getRect(page, getThumbnailSelector(1));
217220
const rect2 = await getRect(page, getThumbnailSelector(2));
221+
console.log('3');
218222

219223
const handlePagesEdited = await waitForPagesEdited(page);
224+
console.log('4');
220225
await dragAndDrop(
221226
page,
222227
getThumbnailSelector(1),
223228
[[0, rect2.y - rect1.y + rect2.height / 2]],
224229
10
225230
);
231+
console.log('5');
226232
const pagesMapping = await awaitPromise(handlePagesEdited);
233+
console.log('6');
227234
const expected = [
228235
2, 1, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
229236
];
237+
console.log('7');
230238
expect(pagesMapping)
231239
.withContext(`In ${browserName}`)
232240
.toEqual(expected);
241+
console.log('8');
233242
await waitForHavingContents(page, expected);
234243
})
235244
);

test/integration/test_utils.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,7 @@ async function dragAndDrop(page, selector, translations, steps = 1) {
586586
}
587587
await page.mouse.up();
588588
await page.waitForSelector("#viewer:not(.noUserSelect)");
589+
await page.waitForSelector("#thumbnailsView:not(.isDragging)");
589590
}
590591

591592
function waitForPageChanging(page) {

web/pdf_thumbnail_viewer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,7 @@ class PDFThumbnailViewer {
733733
}
734734

735735
#onStopDragging(isDropping = false) {
736+
console.error('onStopDragging called');
736737
const draggedContainer = this.#draggedContainer;
737738
this.#draggedContainer = null;
738739
const lastDraggedOverIndex = this.#lastDraggedOverIndex;

0 commit comments

Comments
 (0)