From 86616929531d1a180fba6c7239a262ded3531646 Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Thu, 23 Jul 2026 12:05:29 +0400 Subject: [PATCH] Fix admin book genre hierarchy display Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> --- app/Views/libri/scheda_libro.php | 31 ++++++++++++++++++------------- tests/full-test.spec.js | 6 +++++- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/app/Views/libri/scheda_libro.php b/app/Views/libri/scheda_libro.php index 3add05f90..f8f7d8753 100644 --- a/app/Views/libri/scheda_libro.php +++ b/app/Views/libri/scheda_libro.php @@ -223,20 +223,25 @@ class="inline-flex items-center px-2 py-1 rounded-full text-sm bg-gray-100 text- $gp): ?> diff --git a/tests/full-test.spec.js b/tests/full-test.spec.js index d7e872ea9..b6da28cb4 100644 --- a/tests/full-test.spec.js +++ b/tests/full-test.spec.js @@ -2918,8 +2918,12 @@ test.describe.serial('Phase 18: Issue Regressions', () => { // 1) Admin book detail page await page.goto(`${BASE}/admin/books/${bookId}`); await page.waitForLoadState('domcontentloaded'); - const genreText = await page.locator('[data-testid="genre-display"]').textContent(); + const genreDisplay = page.locator('[data-testid="genre-display"]'); + const genreText = await genreDisplay.textContent(); expect(genreText).toContain(childName); + await expect(genreDisplay.locator('a')).toHaveCount(2); + await expect(genreDisplay.locator('a').nth(0)).toHaveAttribute('href', new RegExp(`/admin/books\\?genere=${rootId}$`)); + await expect(genreDisplay.locator('a').nth(1)).toHaveAttribute('href', new RegExp(`/admin/books\\?genere=${childId}$`)); // 2) Frontend (public) book detail page — uses different query path await page.goto(`${BASE}/libro/${bookId}`);