Skip to content

Commit 4cc93af

Browse files
committed
Improve the selection check in the "doesn't jump when moving selection" integration test
Locally, on Arch Linux, this integration test permafails: ``` 1) Text layer Text selection using selection carets doesn't jump when moving selection Message: second selection: Expected '(frequently executed) bytecode sequences, records them, and compiles them to fast native code. We call such a s' to roughly match /frequently .* We call such a se/s. Stack: at <Jasmine> at UserContext.<anonymous> (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/test/integration/text_layer_spec.mjs:521:12) Message: third selection: Expected '(frequently executed) bytecode sequences, records them, and compiles them to fast native code. We call such a s' to roughly match /frequently .* We call such a se/s. Stack: at <Jasmine> at UserContext.<anonymous> (file:///home/timvandermeij/Documenten/Ontwikkeling/pdf.js/Code/test/integration/text_layer_spec.mjs:529:12 ``` The exact selection can differ a bit per OS/browser. In this case the last character was consistently not selected while on other platforms it is, so this commit fixes the issue by relaxing the regex to not consider the final character so that the test passes if the rest matches.
1 parent 649a03f commit 4cc93af

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

test/integration/text_layer_spec.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,15 +509,15 @@ describe("Text layer", () => {
509509

510510
await expectAsync(page)
511511
.withContext(`second selection`)
512-
.toHaveRoughlySelected(/frequently .* We call such a se/s);
512+
.toHaveRoughlySelected(/frequently .* We call such a s/s);
513513

514514
await page.mouse.down();
515515
await moveInSteps(page, intermediateCaretPos, finalCaretPos, 20);
516516
await page.mouse.up();
517517

518518
await expectAsync(page)
519519
.withContext(`third selection`)
520-
.toHaveRoughlySelected(/frequently .* We call such a se/s);
520+
.toHaveRoughlySelected(/frequently .* We call such a s/s);
521521
});
522522
});
523523
});

0 commit comments

Comments
 (0)