Choose menu anchors, link targets in plugin settings and existing post terms

A menu entry picks its anchor from the linked page, link settings of plugins and own menu
links get page and PDF choice next to the address, and the post settings offer existing
categories and tags to click.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
kantarciandClaude Opus 5 committed 2026-09-22 09:56:07 +02:00
1 parent 3ea28a03fc
commit a976c146de
14 files changed
+306 -7

No files matched your search

+45
View File
@@ -1182,6 +1182,51 @@ try {
assert.equal(await gespeichert.locator('input[name="replyToField"]').inputValue(), 'e_mail');
assert.equal(await gespeichert.locator('[data-field-showif]').nth(2).inputValue(), 'art');
checks.push({ name: 'form editor: condition, reply address and option images are picked', passed: true });
// Menü: der eigene Link bekommt eine Seite per Suche, ein Seitenlink sein Sprungziel per Auswahl.
await page.goto(origin + '/admin/menus');
await page.locator('.menu-add details summary').click();
await page.locator('#link-url').locator('xpath=..').getByRole('button', { name: 'Seite wählen', exact: true }).click();
await page.locator('dialog.page-dialog [role="option"]').first().click();
await page.locator('dialog.page-dialog').waitFor({ state: 'detached' });
assert.match(await page.locator('#link-url').inputValue(), /^\/[a-z0-9\-/]*$/);
await page.locator('#menu-search').focus();
await page.locator('#menu-search-results [role="option"]').first().click();
await page.locator('#menu-add-page').click();
const neuerEintrag = page.locator('#menu-items .menu-entry').last();
const sprungziel = neuerEintrag.getByLabel('Sprungziel', { exact: true });
assert.equal(await sprungziel.evaluate(node => node.tagName), 'SELECT', 'the anchor is a choice');
assert.equal(await sprungziel.locator('option').first().textContent(), 'Seitenanfang');
// Nur die neuen Felder: die Zusammenfassung der Menüeinträge trägt seit jeher einen Ziehknopf
// (nested-interactive), das ist eine eigene, bekannte Baustelle.
await neuerEintrag.locator('summary').click();
const menuAxe = await new AxeBuilder({ page }).include('#menu-items .menu-entry:last-child .menu-entry-fields').include('.menu-add').withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']).analyze();
assert.deepEqual(menuAxe.violations.map(v => v.id), [], 'anchor choice and link field');
checks.push({ name: 'menu: page search for own links, anchors as a choice', passed: true });
// Beitrag: vorhandene Kategorien stehen zum Anklicken am Feld.
await page.goto(origin + '/admin/posts');
await page.locator('summary').filter({ hasText: 'Neuen Beitrag anlegen' }).click();
await page.locator('#new-title').fill('Prüfbeitrag');
await page.locator('form.create-form button[type="submit"]').click();
await page.waitForLoadState('load');
await page.goto(origin + '/admin/posts');
let beitrag = page.locator('details.sheet').first();
await beitrag.locator('summary').click();
await beitrag.locator('input[name="categories"]').fill('Projekte');
await beitrag.locator('input[name="categories"]').locator('xpath=ancestor::form').getByRole('button', { name: 'Speichern', exact: true }).click();
await page.waitForLoadState('load');
await page.goto(origin + '/admin/posts');
beitrag = page.locator('details.sheet').first();
await beitrag.locator('summary').click();
const kategorie = beitrag.locator('input[name="categories"]');
await kategorie.fill('');
const vorschlag = beitrag.locator('.term-chip', { hasText: 'Projekte' }).first();
await vorschlag.click();
assert.equal(await kategorie.inputValue(), 'Projekte');
assert.equal(await vorschlag.getAttribute('aria-pressed'), 'true');
await vorschlag.click();
assert.equal(await kategorie.inputValue(), '');
await axe('post settings with term suggestions');
checks.push({ name: 'post settings suggest existing categories', passed: true });
assert.deepEqual(errors, []);
await writeFile('reports/editor/result.json', JSON.stringify({ checks, publicDataUntouched: true }, null, 2));
console.log('Editor end-to-end checks passed; isolated database, production data unchanged.');