fix: TOC PDF - forcer le rechargement de l'iframe (BUG-063 complement)
This commit is contained in:
@@ -67,11 +67,15 @@ test("viewer.js — TOC links carry a data-page and never poke contentWindow", (
|
||||
);
|
||||
});
|
||||
|
||||
test("viewer.js — navigatePdfToPage reloads the iframe with the #page fragment", () => {
|
||||
test("viewer.js — navigatePdfToPage forces a reload with the #page fragment", () => {
|
||||
const fn = viewer.match(/export function navigatePdfToPage\(area, page\) \{([\s\S]*?)\n\}/);
|
||||
assert.ok(fn, "navigatePdfToPage helper not found");
|
||||
assert.match(fn[1], /data-pdf-url/, "the base URL must be preserved without the fragment");
|
||||
assert.match(fn[1], /iframe\.src = `\$\{base\}#page=\$\{page\}`/, "the iframe must be reloaded with #page=N");
|
||||
assert.match(
|
||||
fn[1],
|
||||
/_pdfpage=\$\{Date\.now\(\)\}#page=\$\{page\}/,
|
||||
"the query must change to force a reload (a fragment-only change is ignored by the native viewer)",
|
||||
);
|
||||
});
|
||||
|
||||
test("style.css — full-bleed viewers ignore the centered reading width", () => {
|
||||
|
||||
Reference in New Issue
Block a user