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:
@@ -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 }) => {
|
||||
|
||||
Reference in New Issue
Block a user