diff --git a/tests/browser/old-urls.spec.mjs b/tests/browser/old-urls.spec.mjs index 2ce3848d..f462a66c 100644 --- a/tests/browser/old-urls.spec.mjs +++ b/tests/browser/old-urls.spec.mjs @@ -8,7 +8,8 @@ const card=(page,text)=>cards(page).filter({has:page.getByText(text,{exact:true} const filtersButton=page=>page.locator('#workspace-main search.toolbar').getByRole('button',{name:/^Filters(?: ยท \d)?$/}); const caption=page=>page.locator('#workspace-main .section-caption > span').first(); const heading=page=>page.locator('#workspace-main h1').first(); -const at=hash=>new RegExp(`/prompt_manager/workspace${hash.replace(/[/#]/g,'\\$&')}$`); +/** The workspace at exactly this hash (the filter of a link is gone from the address by then). */ +const at=hash=>url=>url.pathname.endsWith('/prompt_manager/workspace')&&url.search===''&&url.hash===hash; test.beforeEach(async({page,request,browserName})=>{ await startCoverage(page,browserName);await expect(await request.post('/__test__/reset',{data:{native_library:true}})).toBeOK(); diff --git a/tests/js/legacy-links.test.js b/tests/js/legacy-links.test.js index 56b8c892..bcfb5825 100644 --- a/tests/js/legacy-links.test.js +++ b/tests/js/legacy-links.test.js @@ -73,12 +73,15 @@ test("every target is relative and resolves in the workspace router to the filte test("the redirect page loads the module, replaces the address and always offers the Library link", () => { const html = fs.readFileSync(path.join(__dirname, "../../web/admin-redirect.html"), "utf8"); - assert.match(html, /'; + assert.ok(html.includes(moduleTag), "the page loads the mapping module"); + // The link is plain markup, visible without scripts and when the script fails: the page has no