From a09d21089582bb35e458f61a9bc8f737fe79e92c Mon Sep 17 00:00:00 2001 From: peptiderepo <273788462+peptiderepo@users.noreply.github.com> Date: Tue, 9 Jun 2026 22:24:44 +0700 Subject: [PATCH] test(smoke): label-agnostic admin-menu check (#9) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The peptide CPT menu was restructured (no top-level 'Peptides' label), so the text=Peptides assertion failed. Assert the CPT's admin link by href (a[href*='post_type=peptide']) and toBeAttached — robust to label changes and submenu (hidden-until-hover) placement. Agent-Session: cto smoke-green Co-authored-by: peptiderepo --- tests/03-admin-plugins.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/03-admin-plugins.spec.ts b/tests/03-admin-plugins.spec.ts index a0c97bf..774c246 100755 --- a/tests/03-admin-plugins.spec.ts +++ b/tests/03-admin-plugins.spec.ts @@ -100,8 +100,8 @@ test.describe('WP Admin — Peptide Repo Core admin', () => { // PR Core registers the peptide CPT which creates a "Peptides" menu item const nav = page.locator('#adminmenu'); await expect(nav).toBeVisible(); - // "Peptides" top-level menu item is registered by the peptide CPT - await expect(nav.locator('text=Peptides')).toBeVisible({ timeout: 10_000 }); + // PR Core registers the peptide CPT, which adds a post_type=peptide admin menu/submenu (label-agnostic). + await expect(nav.locator('a[href*="post_type=peptide"]').first()).toBeAttached({ timeout: 10_000 }); }); test('PR Core Settings page loads', async ({ page }) => {