test(smoke): label-agnostic admin-menu check (#9)

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 <peptiderepo@users.noreply.github.com>
This commit was merged in pull request #9.
This commit is contained in:
peptiderepo
2026-06-09 22:24:44 +07:00
committed by GitHub
parent 3ed4b10ecd
commit a09d210895

View File

@@ -100,8 +100,8 @@ test.describe('WP Admin — Peptide Repo Core admin', () => {
// PR Core registers the peptide CPT which creates a "Peptides" menu item // PR Core registers the peptide CPT which creates a "Peptides" menu item
const nav = page.locator('#adminmenu'); const nav = page.locator('#adminmenu');
await expect(nav).toBeVisible(); await expect(nav).toBeVisible();
// "Peptides" top-level menu item is registered by the peptide CPT // PR Core registers the peptide CPT, which adds a post_type=peptide admin menu/submenu (label-agnostic).
await expect(nav.locator('text=Peptides')).toBeVisible({ timeout: 10_000 }); await expect(nav.locator('a[href*="post_type=peptide"]').first()).toBeAttached({ timeout: 10_000 });
}); });
test('PR Core Settings page loads', async ({ page }) => { test('PR Core Settings page loads', async ({ page }) => {